MZ VisuStella OTB Force Action Issue

Hi, I'm using a number of VisuStella plugins, but the two involved in my issue are:
  • Battle System - OTB plugin
  • Skills and States Core

Summary
I have a "Meditation" skill that doesn't immediately do anything, but rather puts the user in a "Meditating" state. When this state expires, I'd like for it to to do the following:
  • Put the user in a "Charged" state
  • Trigger a "Heal" skill that heals the entire party (using a force action)

I'm using the <JS On Expire State> notetag to handle both of these actions:

1767638557260.png



Problem

The user is moved to the "Charged" state as desired, but the "Heal" skill doesn't trigger. It triggers correctly if I disable the OTB plugin, so I'm fairly certain that's where the problem resides. I know the OTB documentation specifically calls out force actions and says they're handled differently, but it seems like they should still work in some capacity.

Out of curiosity, I tried putting the <OTB Instant> notetag on the "Heal" skill, but that doesn't seem to make a difference. I also tried adding this before the force action and it didn't seem to help either: $otbAddBattlerToCurrentTurnEnd(user, 1);

I also tried using $otbAddBattlerToNextTurnEnd and it does add them to the next turn, but it still doesn't trigger the skill.




I saw an older thread about a similar (or possibly the same) issue, but it didn't appear to have a resolution: https://forums.rpgmakerweb.com/inde...-not-being-carried-out-no-matter-what.159924/

My best guess as to why this is happening is because the state is expiring at the end of the turn and actions can no longer be queued up for the current turn, so the skill trigger is simply ignored.

Does anyone have any suggestions on what I could try to get this to work? I've considered just handling the "Heal" manually through scripting, but I wasn't having much luck in animating various battlers in the <JS On Expire State> notetag, plus I'm not sure how to tap into "damage" calculation. The latter isn't a deal-breaker, I guess, since the HP recovery is meant to be small, so I'm still open to that path if it's possible.
From what I recall force action just puts you in the queue to go next time up. That's been my experience with VS. And since they overwrite the entire battle system allowing it any other way would kind of break a lot of things, like for starters having the turn order gauge be inaccurate (which players would complain about).

However I use this and it works for adding HP (and MP) and shows the popup, so maybe you can adapt it? It doesn't show an animation though due to when I time mine I didn't want an animation either.


user.gainHp(user.level * 5);
user.gainMp(Math.round(user.level/2));
user.startDamagePopup()

Try putting that in your On Expire State and edit the values as needed. And of course remove the line for user.gainMP unless you want them to heal MP too. And you'll need to change the part in () to be what they heal for HP, unless you really want it to be the users level x 5.

Original thread: https://forums.rpgmakerweb.com/threads/visustella-otb-force-action-issue.181788/