Help with addState() (bug?) (MZ)

Pretty simple formula here. When I use the skill, the state is not applied and there is no effect on the enemy.

(a.addState(79)); ((a.atk * 4 - b.def * 2) * 1.2

I have tried it with and without the parenthesis. State #79 exists and has effects. When I take out the
(a.addState(79)); the formula works fine. What am I doing wrong here?
Thanks!
please give a screenshot of the skill with the damage formula.

"nothng happens" is usually the case if there is a typo in the formula or the formula returns no valid number or so.
and it wouldn't be the first time (or the hundreds time) that a typo in the original formula was autocorrected when the user retyped it here. But in the screenshot we can check that.
Here are screenshots from the database. Looks fine to me but I'm not super experienced with this.
Mismatched brackets; you have a spare ( after the ;. Try this instead:
  • a.addState(79); (a.atk * 4 - b.def * 2) * 1.2
Also, note that the formula is evaluated by the default AI when deciding what move to use. So, if this skill can ever be used by an enemy (or an actor with the Autobattle trait) then I recommend using a different approach to apply the state, e.g. a common event or a plugin.

(Note: the "Always Attack" state restriction does not use AI.)
Mismatched brackets; you have a spare ( after the ;. Try this instead:
  • a.addState(79); (a.atk * 4 - b.def * 2) * 1.2
Also, note that the formula is evaluated by the default AI when deciding what move to use. So, if this skill can ever be used by an enemy (or an actor with the Autobattle trait) then I recommend using a different approach to apply the state, e.g. a common event or a plugin.

(Note: the "Always Attack" state restriction does not use AI.)
Works perfectly thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/help-with-addstate-bug-mz.138887/