MV Rewind turns in battles?

I need a plugin that allows the player to “rewind time” and undo the latest 5 turns in battle, whenever a certain skill (*coughs* Time Jump *coughs*) specific to one class is triggered.

With this, the amount of HP and MP of all party members and enemies should return to how it was 5 turns ago. Items too, ideally speaking. (TP shouldn't reset, though -- as it's the only way the character should be able to activate this skill)

Is it possible? I searched a lot but didn't find anything similar to this concept designed to MV. Could someone help me, please? :0
How complex this is depends on the mechanics of your battle system, really. For example, are you using cooldowns?
How complex this is depends on the mechanics of your battle system, really. For example, are you using cooldowns?

No cooldowns. The skill requires a very high TP amount, so I think it already prevents the player from abusing it (at least IMO).
That'd require the plugin to memorize each battler's HP, MP, TP, buffs, states (including the durations), etc... and have that history for the last X turns. And it needs to be compatible with your plugins, for instance the Buffs & States Core and its state counters, and it might not cover additional data like custom variables attached to battlers or the battle in general.

Or each battler would have an internal array that records the data they had at the end of each turn, which would take a lot of memory.

That's a pretty big amount of work, which is unlikely to have been done before. Chances are you'll have to hire a programmer to write that for you.
And it needs to be compatible with your plugins, for instance the Buffs & States Core and its state counters, and it might not cover additional data like custom variables attached to battlers or the battle in general.

I'm not using any plugins related to battles.
But it's sad to hear it might be too complicated...
If you're not using anything fancy with skills or skill effects, it shouldn't be too difficult to create a passive state that's present on all actors and monsters which tracks everything they do from turn to turn and stores the last 5 turns in an array, then when the skill is used it restores everything on all battlers to the values from 5 turns prior.
If you're not using anything fancy with skills or skill effects, it shouldn't be too difficult to create a passive state that's present on all actors and monsters which tracks everything they do from turn to turn and stores the last 5 turns in an array, then when the skill is used it restores everything on all battlers to the values from 5 turns prior.
Hey, thanks for the reply! That seems to be my case, but... How do I setup that? Could you please elaborate a tutorial?
@Renchu :
I imagine most all the code changes would probably be in the BattleManager.

I would think that you probably would end up storing your array in BattlerManager that maintains a running record of all the different battlers and their hp/mp (see: BattleManager.setup). You'd probably also have to maintain your own running turn number in there as well.

The logic of actually executing the rewind would probably have to happen in the BattleManager as well, since much of the logic of the battle flow lives there (see: BattleManager.invokeAction). This is where you have access to the actions performed by various battlers, and you can peek at every action to see if it is the given skill you are trying to execute, and if so, do the rewind.

After you've executed the rewind, you'll need to update the tracking array presumably to purge all turns that happened "in the future".

This is pretty high-level and untested/unimplemented, but it sounds good on paper. If you use any plugins that are even remotely related to battle, the implementation details may change.

Original thread: https://forums.rpgmakerweb.com/threads/rewind-turns-in-battles.134315/