Scripting Help! Trying to create a range of possible status effects

I'm currently fiddling around with a troop event using the following script call:


if ($gameParty.members()[0].isStateAffected(499) && !$gameParty.members()[0].isStateAffected(246)) {


$gameTroop.members()[0].forceAction(238, 0);


BattleManager.forceAction($gameTroop.members()[0]);


}


So basically if the actor in index 0 has state 499 but does not have state 246, then enemy in index 0 will use an attack skill#238 on index party member 0.


What I'm trying to change is the first part where it checks if the actor is state affected and make it so that there's a number of possible states that can satisfy the condition (for example lets say any state between # 400 and 500 will do the trick for the first part). I've tried many different things such as $gameParty.members()[0].isStateAffected(400, 500), $gameParty.members()[0].isStateAffected(400..500) and a bunch of other things but I can't seem to figure out how to create this range of possible states. Any help would be greatly appreciated!!!

Original thread: https://forums.rpgmakerweb.com/threads/scripting-help-trying-to-create-a-range-of-possible-status-effects.60226/