Check if a specific battle party member has a state

Hello. When I use conditional branch to check if a party member has a certain state, it will also check the reserve party. But I want it to check only across battle party members only. Is there a way of checking if a specific battle party member has a specific state through script in conditional brench?

Thank you in advance
try
Code:
$gameParty.battleMembers().some(member => member.isStateAffected(STATE))
EDIT: my bad, didnt see the ace thread
When I use conditional branch to check if a party member has a certain state, it will also check the reserve party.
$game_party.battle_members.any? { |mem| mem.state?(2) }

change the number to the state your checking
$game_party.battle_members.any? { |mem| mem.state?(2) }

change the number to the state your checking
Thank you for the response. But how do I specify the party member?
Ok so you want to check battle member 1 or 2 and such. not eric or natalie?
You're basically saying the battle member position not the battle member.
Cause you can use the default built in condition for a specific member but not the member position, so if eric was in position 2 and not 0 then checking for eric might not be what you want.

$game_party.battle_members[0].state?(2)
If you're looking for actors instead of just any party member, this is how you can specify that.

Ruby:
$game_actors[ActorIDWithoutLeadingZeros].state?(StateID)
Actually, I do want to check if Eric or Natalie has a given state, but only if one of them are on the battle party. Consider the following question and answears:

Q: Does Eric has state 1 while being on battle party?
R1: If Eric does not have state 1, then NO, independently of being on the battle party or not
R2: If Eric has state 1 and he is on battle party, then YES
R3: If Eric has state 1, but he is on the reserve, then NO

If I use the default conditional branch, then R3 would be YES instead of NO, and that's not what I want, because it is misleading in the context of my game.

Ok so you want to check battle member 1 or 2 and such. not eric or natalie?
You're basically saying the battle member position not the battle member.
Cause you can use the default built in condition for a specific member but not the member position, so if eric was in position 2 and not 0 then checking for eric might not be what you want.

$game_party.battle_members[0].state?(2)
Actually, I do want to check if Eric or Natalie has a given state, but only if one of them are on the battle party. Consider the following question and answears:

$game_party.battle_members.any? { |mem| mem.state?(2) && mem.id == 1 }
$game_party.battle_members.any? { |mem| mem.state?(2) && mem.id == 1 }
Bro, it worked perfectly. Thank you very much

Original thread: https://forums.rpgmakerweb.com/threads/check-if-a-specific-battle-party-member-has-a-state.162643/