MV Script/Code needed to target all active Party Members?

So this skill I have targets a single enemy, and after damaging said enemy I want the whole active party to have a state added to them but idk what to plugin into the notetag of the skill to have it do that? I know I have to change "target" before the ".isStateAffected" & "addState" stuff in the notetags but idk what im supposed to change "target" to so that it'd give the state to my active party rather than the enemy that was just attacked?
1755551217266.png
after damaging said enemy
as a note, you might want to use a <Post-Damage Eval>. <After Eval>s run regardless of the skill hitting its target or not. <Post-Damage Eval>s require a hit.

it'd give the state to my active party rather than the enemy that was just attacked
so you want it so that a battler uses this skill on an opponent, but that same battler's party gets the state? cause between what you said and the attempt in the screenshot of what you gave its unclear.

replace the entire contents of the tag with
Code:
user.friendsUnit().aliveMembers().forEach(m => m.addState(410))
But remember that this will be run per target of the skill. So if this is used in a skill that hits multiple targets and it would be undesirable to apply the state to each of those battlers on every hit, then youd want to either put it in a <Custom Execution> notetag or put it in a <Finish/Follow Action> of an Action Sequence
as a note, you might want to use a <Post-Damage Eval>. <After Eval>s run regardless of the skill hitting its target or not. <Post-Damage Eval>s require a hit.


so you want it so that a battler uses this skill on an opponent, but that same battler's party gets the state? cause between what you said and the attempt in the screenshot of what you gave its unclear.

replace the entire contents of the tag with
Code:
user.friendsUnit().aliveMembers().forEach(m => m.addState(410))
But remember that this will be run per target of the skill. So if this is used in a skill that hits multiple targets and it would be undesirable to apply the state to each of those battlers on every hit, then youd want to either put it in a <Custom Execution> notetag or put it in a <Finish/Follow Action> of an Action Sequence
Sorry, I made it confusing...
But yes you got it right, I do want it so that a battler uses this skill on an opponent, but that same battler's party gets the state.

Also I do want it to happen regardless of the skill hitting or not so it's fine for it to be <After Eval>

Anyway I really should've gave more context, that's very much so my bad... but basically the skill has conditional branches depending on the current state of the user. If the user has "state 1" then it will give everyone "state 2" upon the skill being used again, and then "state 3" if "state 2" is currently applied. I tried the code you sent me but it seemed to skip straight from applying "state 1" to applying "state 2"?
Is there a way to make it so that it doesnt do that?

(Screenshots are the same line, just the full view of the code)
1755558426415.png
1755558195945.png
Sorry, I made it confusing...
But yes you got it right, I do want it so that a battler uses this skill on an opponent, but that same battler's party gets the state.

Also I do want it to happen regardless of the skill hitting or not so it's fine for it to be <After Eval>

Anyway I really should've gave more context, that's very much so my bad... but basically the skill has conditional branches depending on the current state of the user. If the user has "state 1" then it will give everyone "state 2" upon the skill being used again, and then "state 3" if "state 2" is currently applied. I tried the code you sent me but it seemed to skip straight from applying "state 1" to applying "state 2"?
Is there a way to make it so that it doesnt do that?

(Screenshots are the same line, just the full view of the code)
View attachment 347749View attachment 347748
Actually while sending this reply, I realized I could probably just common event this and make it way more simple for myself, Sorry, I'll see if I can make it work that way but if not I'll let you know
Actually while sending this reply, I realized I could probably just common event this and make it way more simple for myself, Sorry, I'll see if I can make it work that way but if not I'll let you know
Ok yeah I got it to work! Sorry for the confusion

Original thread: https://forums.rpgmakerweb.com/threads/script-code-needed-to-target-all-active-party-members.179637/