$gameParty.allMembers().some(who => who.isStateAffected(4))That includes members not participating in battle. If you only want the fighting members, I believe it's
battleMembers, and if I recall correctly, just members will also work (and include only battle members when in battle, but all members otherwise).Obviously replace 4 with the ID of the state you're checking.