Help with a clearly defined, undefined method

Alright I'm trying to show the actors level if the actor doesn't have a state applied. If there is a state applied it will show the state name instead. What is happening is that an error shows up saying "undefined method state? Etc. Etc." But it is clearly defined below. Any ideas? Here is a snippet of the code, I have no internet any more do it's the best I could do on my phone.

self.contents.draw_text(x, y, 64 + w3, actor.level, 2) if @actor.state?(-1) #no state applieddef state?(state_id) return @states.include?(state_id)endSo it is defined. I'm also unsure of what to put for no state, like -1 or nil. One other note I used the same type of state script to disable the skill menu like so

return false if @actor.state?(4) No issues. That's a silenced state where no magic can be used. Any help would be appreciated.

I apologize if this is in the wrong section but I figured it is a request of sorts.
Did you put the state? method in Game_Actor class?

self.contents.draw_text(x, y, 64 + w3, actor.level, 2) if @actor.state?(-1)Why the first actor is actor and the second one is @actor ?

What is the full error? Is it undefined method state? for nil class ? If so then the @actor isn't defined and it is nil.
you used "actor.level" yet also used "@actor.state"?

and which class are you defining this in? only classes that inherit from Game_BattlerBase can use @states
By the way, Game_Battler already has the state?(state_id) method. I don't see why you have to define it again unless it's a different class.
Ok lI can't give the exact error as I'm at work but yes this is a different method. It's a whole separate class. Instead of using my example of poor scripting (I can't really script at all, it's above my head) let me just ask this

In a menu sub screen I want to show the actor's status. Where the level is displayed I want to show states if they are applied. So if no states were applied the level would be shown as Normal. But say if death was applied it would say "dead" where the level should be. The current unedited level part of the script is

Code:
self.contents.draw_text(x, y, 64 + w3, WLH, actor.level, 2)
How would I go about overwriting that to show text based on applied state. The bit of code I used with the @actor.state? I got from the conditional branch section of the game_interpreter so I thought that would work. All previous methods are defined including @actor.
It is in Window_MenuStatus, correct? If so, replace draw_actor_level(actor, x, y + WLH * 1) in refresh method with this:

Code:
if actor.state?(death state id)  self.contents.draw_text(x, y + WLH * 1, 64, WLH, "Death")else  draw_actor_level(actor, x, y + WLH * 1)end
Yeah thanks! I realized what you guys were talking about in my above script. I didn't notice I had @actor it should have been @actor1 and actor.level should have been @actor1.level. My scripting was all jacked up.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-a-clearly-defined-undefined-method.44393/