.isStateAffected(N)

how do i check for multiple states without flooding note space of a state?
With my frozen state i'm checking if the battler have one of my other states, then removing it
this is a template i made:
<Custom Apply Effect>
if (target.isStateAffected(2) === true){
target.removeState(2);
}
if (target.isStateAffected(4) === true){
target.removeState(4);
}
if (target.isStateAffected(5) === true){
target.removeState(5);
}
if (target.isStateAffected(6) === true){
target.removeState(6);
}
if (target.isStateAffected(7) === true){
target.removeState(7);
}
if (target.isStateAffected(8) === true){
target.removeState(8);
}
if (target.isStateAffected(9) === true){
target.removeState(9);
}
if (target.isStateAffected(10) === true){
target.removeState(10);
}
if (target.isStateAffected(12) === true){
target.removeState(12);
}
... and so on.

since no all states from 1 to max are noted, i need a compacted version that allow me to custom select the ids.
</Custom Apply Effect>it's so ugly and long, i need something better than this and I'm still learning javascript.

Any help is appreciated.
You could use the "Status Resistance" trait for the Frozen Status.
This way you can set all the Statuses that you want to be removed when Frozen is applied.

Or, if you want to use JavaScript, use this in <Custom Apply Effect>:
Code:
var status;

for(status = 1; status <= "the number of statuses in your database"; status++)
{
   if (target.isStateAffected(status))
   {
     target.removeState(status);
   }
}
yeah i forgot the state resist erasing, thanks anyway xD
yeah i forgot the state resist erasing, thanks anyway xD
No problem!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/isstateaffected-n.120665/