Current Enemy state

I've got a rather simple question, how do I replicate this conditional branch with a script:
1623680797473.png

Because I want the enemy id and state to be pulled from variables instead.
$gameTroop.members()[index].isStateAffected(id)
$gameTroop.members()[index].isStateAffected(id)
As always, thanks for the quick reply.
As always, you're more than welcome. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/current-enemy-state.137463/