MZ Trying to learn JavaScript

I see. That could work out nicely. I’ll have to try it when I’m able to.
Would it be possible to use a variation of the state removal tag but for the skill so that when the skill duration ends it returns the variable back to normal? Did my question make sense?
Yeah I guess if you have the skill put the state on yourself (I suppose the notetag codes run outside of battle too, but haven't tested). Then just set how many steps to remove it in the database.
Okay, I’m trying to use a code in my skill by having it add a state that runs a common event but I can’t get the code to run. I’m unsure as to what I’m missing for the code.

<JS On Add State>
Game_interpreter.command117([1])
</JS On Add State>
<JS On Expire State>
Game_interpreter.command117([2])
</JS On Expire State>

Am I using the wrong code? Or am I just missing something?
I think it should be (in battle): $gameTroop._interpreter.command117([1]);

That seemed to work for me, but I don't understand that 'interpreter' stuff. Trihan wrote a thread about it, if you want to read about it. I always use the 'reserve common event' scripts, but they aren't run immediately. I think the above script is (if I have understood it correctly). But yeah, ask someone who knows how to code LOL.

EDIT: On the map it's: $gameMap._interpreter.command117([1]);

EDIT2: To clarify, the scripts are run immediately, but I meant that when using the 'reserve' script, the common event isn't run immediately.
Yeah I couldn’t get it to work at all. The common event just won’t run. It’s meant to target the main character but nothing works. This coding stuff is really hard. It’s fun but hard.

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-learn-javascript.176438/