Hello. I need to do two things: make an actor regenerate MP (in and out of battle) by the amount of his current HP divided by 4, and limit the max MP he will be able to regenerate if he's hurt, to the same percentage his current HP is at from his max HP. What I mean is, for example: if the actor has 300 HP (max) and 150 MP (max), he would regenerate 75 MP per turn in battle; if he has 200 HP he'd regenerate 50 MP, and so on. If the actor was at 300 HP, then his MP would recover fully and at its fastest pace, but if he was at 200 HP (66% of his max HP), then his MP would regenerate slower and the regeneration would stop at the same percentage (99 MP of 150, which is also 66%).
I also want to apply the same regeneration mechanics outside of battle. And every actor would have the same regeneration mechanics from the start of the game, so they aren't supposed to be triggered by skills. I have no idea how to do any of these things, so any help would be appreciated.
I also want to apply the same regeneration mechanics outside of battle. And every actor would have the same regeneration mechanics from the start of the game, so they aren't supposed to be triggered by skills. I have no idea how to do any of these things, so any help would be appreciated.


