Script call to count states?

Hey there, I am currently using the script "Stacked States" and was wondering how I could do a script call in an event to count how many of state X there is on one actor / enemy. Looking at the code I tried something like this but no luck :/

Note I am trying to count a specific state, not states in general.

Code:
@a = $game_party.battle_members[0]@b = @a.states(5).count.to_s$game_message.add(@
looking at it, he has a def for it:

  def state_stack(state_id)    ## Gets the number of times the state is stacked. (@states.count(state_id) || 0)  end
Code:
edit: sorry posted before I was ready
so you'd want to do your

a = $game_party.battle_members[0]b = a.state_stack(5)$game_message.add(assuming 5 is your state's ID you're checking. you don't need the @ before your variables, they serve no purpose in script calls because variables are thrown away as soon as the script call is finished.
Thanks a lot that worked, dont know why it didnt work when I tried it...

Original thread: https://forums.rpgmakerweb.com/threads/script-call-to-count-states.25645/