Trying to retain HP% when Max HP changes due to states added/removed

I'm pretty new to RPG Maker MV (and this forum), so this may be a dumb question. I don't think it is, however, because I've done hours of research trying to find answers and figure this out, to no avail.
Here's a rundown of my issue.

Actor Alvin has a MHP of 20. State Super is applied to Alvin, which alters Param MHP 150%, resulting in new MHP 30. Alvin then takes 15 damage. Alvin is at 50% MHP. Super is removed by a skill, causing Alvin's MHP to return to normal: 20. However, Alvin's current HP is still 15. I need Alvin's current HP to be the same percentage after Super is removed as when it is applied. So for the above example, I want Alvin to go from 15/30 HP to 10/20 HP, not 15/20 HP.

I also have a State Weaker that, when applied, alters Param MHP 75%, and I need it to work the same way, setting Alvin's current HP to the same percentage as it was before Weaker was removed. For example, when Weaker is applied, Alvin's MHP is 15. Alvin takes no damage. When Weaker is removed, Alvin's MHP is now 20 again, but his current HP is still 15, even though he took no damage.

I've exhausted my admittedly limited understanding of the system and have spent several hours researching this. Maybe I'm just looking in the wrong places or going about the problem incorrectly. I'd really appreciate any insight or help that could be offered.
Unfortunately there's no real way to solve this using default functionality, because there's no way to explicitly know when a state is added/removed. You have to use plugins. You could approach it one of two ways:

While a somewhat-useful version of this could probably be rigged up using State Remove tags in Yanfly's Buffs & States Core, your best bet is probably to create your own custom plugin to calculate the HP% before a state (or other database item) with a Max HP state is removed, and then set the battler's HP afterwards to keep that same percentage... or to request such a plugin on the JS Plugin Requests board; this is probably a do-able plugin that someone could help you with.

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-retain-hp-when-max-hp-changes-due-to-states-added-removed.126488/