Self-Induced Status text not displaying

I have an attack which requires that the user recharge afterwards. I used a.addState in the damage formula to give it to the user, and it works, but the text does not display as it should when the state persists. In the state window, I have it set to say "(user) is recharging!" but nothing comes up. Anyone know how to fix this?

I've moved this thread to MV Support. Thank you.

(Originally posted in General Discussion.)

The "persist" message should display. If it's not showing for you, maybe share a screenshot of your state in the database?

I think the "add state" message does not display in this case because by default the engine only checks the action target for damage, states, etc, not the user. Possible solutions:
  1. Manually show battle log text via the damage formula, e.g.

    BattleManager._logWindow.addText(a.name() + " is recharging!"); a.atk * 4 - b.def * 2
  2. Manually trigger the user's "state add" message(s) via the damage formula, e.g.

    a.addState(10); BattleManager._logWindow.displayAffectedStatus(a); a.atk * 4 - b.def * 2
  3. Find a plugin that automatically checks/displays this stuff (YEP_BattleEngineCore?).
Generally the damage formula is only meant for calculating a value, not for actually applying effects. You may also run into problems if this skill can be used by any actor with an Autobattle trait, since the AI evaluates potential actions' formulae to decide which one to use. That's why plugins like YEP_SkillCore offer pre-/post-damage notetags, so you can separate on-use effects from the actual formula.

Original thread: https://forums.rpgmakerweb.com/threads/self-induced-status-text-not-displaying.148014/