This wouldn't be hard to do with Yanfly's Buffs & States, no need for Lunatic stuff or programming the entire thing into an Action Sequence.
In the state itself, give it the Restriction: Cannot Move - that will prevent the actor from doing anything on their turn.
In the notetag, do:
Code:
<Custom Remove Effect>
user.gainHp(Math.min(user.mhp-user.hp, user.hp*.35));
</Custom Remove Effect>
The slightly trickier part is them not being able to be attacked. Do you mean that they literally can't be targeted for an attack? Or is it okay if they just take zero damage?
If the latter, put into the state's notetags:
Code:
<Custom React Effect>
value=0;
</Custom React Effect>
If you don't want them to be able to be targeted, that's trickier, and I can only think of using Yanfly's AI Core and programming it into every enemy in the game, to ignore targets with that state. You might be able to write a plugin that ignores them for targeting like it does with the Knockout state, but I don't know of an existing one.
Edited to use a function that should show healing popup numbers in combat.