MV "Compulsory Life Tap" on Actor at the End of Every Turn

So for my project, damage the player takes works in a weird way. Most enemy attacks do not affect the player's HP bar directly, and instead deal damage to the MP bar. At the end of EVERY turn, the game checks the player's MP and subtracts whatever's missing from the player's HP bar; if the HP reaches 0 in the process, the Actor dies (obvious). The MP bar is then fully restored. The primary objective of my project handling player health this way is to make the phenomonon of "Health Crunch" (ie the player losing an overwhelmingly majority of their health to a single attack-- or turn in the case of Turn-Based games) a complete non-concern for the player.

Originally, I was just going to have this calculated through a Troop Event occurring at the end of every turn, using the "Change HP" event command:
1637525452900.png


This technically works (when the MP bar writes a check the HP bar can't cash, the Actor dies and the game over processes before the player can pick next round's move)(note- this only works), HOWEVER the player's HP/MP bar does not actually display on that the calculation has happened until the start of the following turn.


So, here's the script I need:

At the end of every turn in combat-- before the player selects an input for the next turn --the Actor's HP is subtracted by their missing MP, and then fully restore their MP. The battle scene then needs to immediately redraw the health and mana bar after this calculation has been made, BEFORE the player inputs for the next turn.


(last-sec edit: also please make sure it's compatible with mjshi's PrettySleekGauges? *pleading face*)
At the end of your event, try putting in the following script command:

SceneManager._scene._statusWindow.refresh()
Just to put it out there, I can't duplicate this. Do you have plugins installed that you can troubleshoot? When I create a turn end event using the Change HP command, the difference is reflected in the gauge at the beginning of the next turn.

(I can't tell whether it's instantaneous from the event command or at the beginning of the next turn, but it's definitely not after you choose your command as your video shows)

Trihan's solution should work, but if something is causing erroneous behavior here, it might cause other problems in your game, also.
At the end of your event, try putting in the following script command:

SceneManager._scene._statusWindow.refresh()

ur an wizerd. <3

Just to put it out there, I can't duplicate this. Do you have plugins installed that you can troubleshoot? When I create a turn end event using the Change HP command, the difference is reflected in the gauge at the beginning of the next turn.

(I can't tell whether it's instantaneous from the event command or at the beginning of the next turn, but it's definitely not after you choose your command as your video shows)

Trihan's solution should work, but if something is causing erroneous behavior here, it might cause other problems in your game, also.
Upon reading this, I did a couple "tests" (aka turning things on-and-off), and I figured out what was causing the display to not update; my project uses the plugin posted to this thread.
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/compulsory-life-tap-on-actor-at-the-end-of-every-turn.142354/