(SOLVED) Damage formula that adds FLAT amount of damage per FLAT amount of HP missing.

What I want to achieve, is formula, that adds X amount of damage (let's say 10) for every Y amount of HP missing (let's say 30). So, if I have actor with 100 max HP, and it has only 40 left, the attack, that would otherwise have 5 damage, have 25.
I tried to look a bit for "less hp = more damage" formulas, but didn't really found something like that, so thanks in advance. I also have VisuMZ free plugins, if that's helpful.
EDIT: Solved! If any lost soul is going to struggle the same, here's the formula (replace some numbers):
5 + ((a.mhp - a.hp) * 10 / 30)
your damage formula + Math.floor((a.mhp-a.hp)/30)*10

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-damage-formula-that-adds-flat-amount-of-damage-per-flat-amount-of-hp-missing.163402/