HP/MP regeneration only in battle

Hello everyone,


I'm having a little problem with regeneration (had the same with VX Ace) : I want to create accessories that can regenerate HP/MP, but I only want them to work during battles.


Currently, it seems that the regeneration works outside of battles too, which is a game-breaker : you just go round and round and your HP and MP are back to 100% (regeneration seems to activate every 20 steps or so).


I really don't want that to happen, whereas it could make a good accessory if it only worked during battles.


Have you got any solution for that ?
Make the regeneration only happen by state, make sure that those states end when the battle ends.


Then either use a troop event to check for the equipped items and give those states to those who have them at turn 0, or use a plugin that activates states in battle on whatever conditions and set those conditions to the accessories.
Put this in troop events: 


If : Script : $gameActors.actor(actorId).equips().contains($dataArmors[n])


Change State: (actorid), +(state)


n=the number in the database that the accessory is


You will have to do this for each piece of equipment that has this state you want and for each actor, unless someone knows of a way to check party members' equips.  There is a plugin that you would only need to put this in one troop event though and the plugin will make it so the game puts this in every troop.


http://yanfly.moe/2015/10/18/yep-15-base-troop-events/
Good thinking ! Thanks to you both

Original thread: https://forums.rpgmakerweb.com/threads/hp-mp-regeneration-only-in-battle.67972/