How to make an HP regen buff/state based on another actor's max HP?

So I'm trying to make a regen buff/state in which the amount of HP it restores per turn isn't based on the max HP of the actor the buff/state on but the max HP of the one that casts the buff/state

So for example:
Actor A has 1000 HP
Actor B has 500 HP

Actor A casts regen on Actor B for 2 turns

On Actor B's turn they regen for 10% of Actor A's max HP which is 100

(The sentence below is optional but just a thought on what could happen as well)
And say through buffs on the 2nd turn Actor A has a bigger max HP to 1500 and so subsequently the regen on Actor A increases to 150 instead of 100 because Actor A has a bigger max hp.

Also if it's of any help only 1 actor will have this skill so I think referencing the max hp would be simpler than if multiple actors had the same skill

Now how would I go about this? Or if plugins are needed which ones would it be?

Thank you to anyone taking their time to reply to this
can't be done without a plugin, and you'll need one for advanced state functions.
then basically use javascript to store the caster value somewhere and reference that in an effect formula
can't be done without a plugin, and you'll need one for advanced state functions.
then basically use javascript to store the caster value somewhere and reference that in an effect formula
Do you think something like the visustella core plugins could be able to achieve this?
Do you think something like the visustella core plugins could be able to achieve this?
Just to check - you posted in MZ Support, but your profile says you use MV. This is for MZ?

If yes, then sure, you can read through the description of the VisuStella plugins. The Skills and States Core has notetags for what they call "slip healing".

If you're not already using VisuStella and you want something more lightweight, my Eval Tags plugin has a Regenerate Eval notetag.
Just to check - you posted in MZ Support, but your profile says you use MV. This is for MZ?

If yes, then sure, you can read through the description of the VisuStella plugins. The Skills and States Core has notetags for what they call "slip healing".

If you're not already using VisuStella and you want something more lightweight, my Eval Tags plugin has a Regenerate Eval notetag.
Yes I mostly use MV up until last week, that's why I'm not too familiar with MZ plugins

And I just re-read the massively long help file of the VS plugin, seems like the slip healing tag is exactly what I'm looking for. I'll check out your plugin as well if I run into issues implementing this with VS's plugins

Thank you so much for the help
This is for anyone searching

notetag and formula is literally just this:
Spoiler: Formula
<JS type Slip Heal>

heal = user.mhp*0.1;

</JS type Slip Heal>


i used the VisuStella Skills and States Core like what Turan mentioned and put this in a State's notetag. of course the "user.mhp*0.1" could basically be any formula
And say through buffs on the 2nd turn Actor A has a bigger max HP to 1500 and so subsequently the regen on Actor A increases to 150 instead of 100 because Actor A has a bigger max hp.
for this part, i just needed to add

<JS Slip Refresh>

to the note tag. which from my reading means whatever formula for the heal is recalculated each time the heal happens
i feel kinda dumb that i missed such a simple notetag lol
This thread is being closed due to being solved. If you need it reopened, report it to let us know why. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-an-hp-regen-buff-state-based-on-another-actors-max-hp.166147/