MV How to apply a Passive State to allies who have a certain skill equipped? (Yanfly's Auto Passive States & Conditional Passives)

Hi, so I'm currently trying to implement a way of linking character's in my game using skills. When 2 character's share a link, they get a state. Do you know if there's a way to add aura passive to allies who only have a certain skill equipped? Ex. Actor 1 & Actor 2 both have the skill flame charger, but actor 3 & 4 don't. So only actor 1 & 2 get the state.
Moved to: Plugin Support
When 2 character's share a link, they get a state. Do you know if there's a way to add aura passive to allies who only have a certain skill equipped? Ex. Actor 1 & Actor 2 both have the skill flame charger, but actor 3 & 4 don't. So only actor 1 & 2 get the state.
im still a little confused on what you have here. your actors equip skills instead of learning them, so you need for this to be able to work with any assortment of actors because any two could have the skill equipped, right? depending on what this link is intended to do, some ways of going about it are better than others. assuming its a stat buff state or something that you want active during battle, id have whatever system you have that gives them flame charger to also give them a passive state with this as its effect:

JavaScript:
<Custom Turn Start Effect>
var allies = user.friendsUnit().aliveMembers();
for (var i = 0; i < allies.length; i++) {
  if (allies[i].isStateAffected(stateId) && allies[i] !== user) {
    user.addState(x); //replace x with state 2's id
  }
}
</Custom Turn Start Effect>

And then have the actual buff state with the effect you want last 1 turn and be given to your actors by this one

Edit: originally had said to make it a 2 turn buff and had it check both at the end of a turn and at the start of battle. i changed it to turn start and 1 turn at some point before podting but forgot to remove the <custom battle effect>. it doesnt change much, but its redundant
im still a little confused on what you have here. your actors equip skills instead of learning them, so you need for this to be able to work with any assortment of actors because any two could have the skill equipped, right? depending on what this link is intended to do, some ways of going about it are better than others. assuming its a stat buff state or something that you want active during battle, id have whatever system you have that gives them flame charger to also give them a passive state with this as its effect:

JavaScript:
<Custom Battle Effect>
var allies = user.friendsUnit().aliveMembers();
for (var i = 0; i < allies.length; i++) {
  if (allies[i].isStateAffected(stateId) && allies[i] !== user) {
    user.addState(x); //replace x with state 2's id
  }
}
</Custom Battle Effect>

<Custom Turn Start Effect>
var allies = user.friendsUnit().aliveMembers();
for (var i = 0; i < allies.length; i++) {
  if (allies[i].isStateAffected(stateId) && allies[i] !== user) {
    user.addState(x); //replace x with state 2's id
  }
}
</Custom Turn Start Effect>

And then have the actual buff state with the effect you want last 1 turn and be given to your actors by this one
Hi, the way the system works is, character's get different classes the more the progress the game. Depending on the class they have currently equipped, they may have different links (aka skills that can't be used, but provide passive states when another character shares the same one as them). Also thanks, I'll test it right away. Sorry to ask, but where do I place this formula?
Depending on the class they have currently equipped, they may have different links (aka skills that can't be used, but provide passive states when another character shares the same one as them).
Ah, i see now. what i gave you should still work. what youll have to do is this:
for every link you want, make a skill and give it to the class at whatever level they should have it. then, make a pair of states for each link.

One of these is passive and could be like the one above (at the start of each turn it checks if theres someone else with the same state is alive and if there is, gives them the buff). The second state (the one that goes into the addState(x); ) could be whatever effect you want but have it last 1 turn.

then the last thing is to add the first state as a passive skill though <Passive State: x> in the skill's notebox.

its not the most elegant way of doing it, but it should work... mostly

Sorry to ask, but where do I place this formula?
Place what i had in the last post in the notebox of the passive state and it should work. the <Passive State: x> i mentioned above goes into the notebox of the skill that your class learns
Ah, i see now. what i gave you should still work. what youll have to do is this:
for every link you want, make a skill and give it to the class at whatever level they should have it. then, make a pair of states for each link.

One of these is passive and could be like the one above (at the start of each turn it checks if theres someone else with the same state is alive and if there is, gives them the buff). The second state (the one that goes into the addState(x); ) could be whatever effect you want but have it last 1 turn.

then the last thing is to add the first state as a passive skill though <Passive State: x> in the skill's notebox.

its not the most elegant way of doing it, but it should work... mostly


Place what i had in the last post in the notebox of the passive state and it should work. the <Passive State: x> i mentioned above goes into the notebox of the skill that your class learns
Works absolutely perfectly, thank you so much. Lost sleep trying to work on this all night.
Works absolutely perfectly, thank you so much. Lost sleep trying to work on this all night.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-apply-a-passive-state-to-allies-who-have-a-certain-skill-equipped-yanflys-auto-passive-states-conditional-passives.157061/