Stats grow as hp goes down

I am not asking about only making more damage with abilites cause its a simple formula for it but I want to give more att/def/agi etc. when hp goes down. Like in 100%Hp 100atk and 100def, 50% 150atk and 150def. ( open to plugins in needed )
An easy way to do this is to adjust the attack formula's. This means all characters using the same skill, will gain the same buffs. Also the enemies.

a damage formula that normaly is this:
a.atk * 4 - b.def * 2

would become something like this:
( (a.mhp - a.hp) / a.mhp + 1 ) * a.atk * 4 - ( (b.mhp - b.hp) / b.mhp + 1 ) * b.def * 2

In this case, the ATK and DEF are still the same value no matter how much HP you have, but each point of ATK and DEF will become more valuable the more damage you took, up to 200% when at <1% HP
You'd have to use a dynamic parameters plugin. I believe both Quasi's Params Plus and Hakuen Studio's Dynamic Parameters should work.

Original thread: https://forums.rpgmakerweb.com/threads/stats-grow-as-hp-goes-down.165935/