Determining the users state from within a plugin

Hi all,

I am mostly a beginner at writing code but I can usually fudge my way through simple things. I'm hoping some of you here can help with what I am trying to do.

From within a plugin I would like to have a part that basically does this:

if user has state (x)
do A
else
do B

The problem i am having is I don't know how you would check the users state.

I know in scripts within the game engine you can do things like "$gameActors.actor(1).isStateAffected(7)" but that only gets Actor 1's status. But I need to know how to check if the character using the skill has the state. Basically what I need is the equivalent of this:

$gameActors.actor( The current actor currently doing a skill's ID ).isStateAffected(7)

Any help would be greatly appreciated. Even if its a more complicated process for determining the Actor that is currently doing a skill in battle, the slightest bit of insight would go a long way.

Original thread: https://forums.rpgmakerweb.com/threads/determining-the-users-state-from-within-a-plugin.121829/