MV Removing states from all party members using a script

Hello,
I'm currently trying to create a skill, where after 1 turn of preparation all negative states from the party get removed.
I tried solving this with a state and the Yanfly BuffStatesCore-plugin: The state is self inflicted using the skill, is removed after one turn and has the custom effect:

<Custom Remove Effect>

$gameParty.allMembers().removeState(3);

</Custom Remove Effect>

This is my first time writing a script for RPG maker, so it was almost expected that this was not going to work - however, I have no idea how to fix it. I tried to orient myself with the Script Call List, but I couldn't really find anything else that wuld represent the entire party.
Thanks in advance for any help!

I've moved this thread to Javascript/Plugin Support. Thank you.


This is my first time writing a script for RPG maker, so it was almost expected that this was not going to work - however, I have no idea how to fix it. I tried to orient myself with the Script Call List, but I couldn't really find anything else that wuld represent the entire party.
when youre working with Yanfly's custom anything notetags, you will be working with javascript and will need to be familiar with it alongside the engine specific stuff. Just using the script call list alone generally wont be enough to get by when youre writing JS for those tags.

$gameParty.allMembers().removeState(3);
allMembers() returns an array of every actor the player has and removeState is a function for individual battlers. you would need to loop through the array and call removeState on each member within

try this
Code:
$gameParty.allMembers().forEach(member => member.removeState(3))

as an aside: it might be worth considering making the skill apply the state to all party members and have the state only remove the negative states of the battler its on. if you have this state on one battler and the one state alone cures the enitre party, then dying early will trigger the remove effect.
You could also make it a <custom turn end effect> and have the state also remove itself when it happens to avoid death triggering it

Original thread: https://forums.rpgmakerweb.com/threads/removing-states-from-all-party-members-using-a-script.177722/