How to put passive states on enemies by you having a skill

Im looking through Auto Passive States YEP, but i cant find a way to apply a state on all enemies at the start of fight if a certain skill is owned by an actor. The passive conditions seem to apply on the actor himself and not enemies.
I haven't tried it myself, but I believe you'd give the enemies a passive state notetag like <Passive State: x>. Then you'd give state x a custom passive condition notetag:
<Custom Passive Condition>
Javascript code in here
</Custom Passive Condition>
to see if the state is active or not. Your code should return condition = true if the actor owns the skill, or condition = false if they don't. (For example, $gameParty.members()[0].hasSkill(42) would test if the party leader has skill 42 in his skill list).
The passive conditions seem to apply on the actor himself and not enemies.
you make the passive's effect to apply the state to all enemies at the start of the fight
Code:
<Custom Battle Effect>
user.opponentsUnit().aliveMembers().forEach(member => {
    member.addState(x);
})
</Custom Battle Effect>
or use yanfly's aura plugin to make the state apply the other state as an aura effect
I haven't tried it myself, but I believe you'd give the enemies a passive state notetag like <Passive State: x>. Then you'd give state x a custom passive condition notetag:
<Custom Passive Condition>
Javascript code in here
</Custom Passive Condition>
to see if the state is active or not. Your code should return condition = true if the actor owns the skill, or condition = false if they don't. (For example, $gameParty.members()[0].hasSkill(42) would test if the party leader has skill 42 in his skill list).
auto applies even with the condition if i give them the passive

you make the passive's effect to apply the state to all enemies at the start of the fight
Code:
<Custom Battle Effect>
user.opponentsUnit().aliveMembers().forEach(member => {
    member.addstate(x);
})
</Custom Battle Effect>
or use yanfly's aura plugin to make the state apply the other state as an aura effect

where would i put this code? i put it in the skill and the state wasn't applied.
where would i put this code? i put it in the skill and the state wasn't applied.
its for the passive state but made a typo. the S in addState wasnt capitalized.
the original has been edited now.
ok it gets applied all good, but it also gets applied to me which shouldn't happen. Any fix?
Your passive is state 10 and youve applied state 10 to the enemies. the passive and the state youre trying to apply should be different. the passive's effect should be to give the enemies the other state, like you mentioned.
apply a state on all enemies at the start of fight
Alright i see. It works all good now, thanks.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-put-passive-states-on-enemies-by-you-having-a-skill.177352/