Hum... Are you referring to
this lunatic object script? If so, then the script is not made to be used with states.
Instead, you probably wanted to use
lunatic states?
Regardless, your notetags don't seem to have the right syntax (follow the script description or link us to the script you are using).
Also note that yanfly's lunatic scripts are meant to serve as baselines for added scripts that add effects, I don't think they are meant to run code, unless you have an addon that does so.
To run your code, you might want to use battle events (maybe you can even find a common battle event script) or you can find another script that does this.