If Actor X has State X

Hello. I'm looking for how to check if an Actor ID from a variable has a State ID from a variable, and turn a switch on or off for yes or no.

I tried searching for it but only found different variations or ones for different rpg makers.
Sorry if this is a redundant question, thanks in advance!
$game_actors[$game_variales[1]].state?($game_variables[2])
1716946260251.png


Not tested
Works! Thanks muchly

Original thread: https://forums.rpgmakerweb.com/threads/if-actor-x-has-state-x.169077/