Request: Dmg diminishing returns

I have a character that the more he's dealt damage, the stronger he'll get by utilizing this formula for one of his skills

(a.tp/20) * a.atk * a.mhp / a.hp

Only problem is, at lvl 1, he has 12 attack, max tp, he has 5, and his hp is at 280. 

5 * 12 * 280 = 16,800 at level 1 in damage that he can potentially cause. 

At level 99, that becomes 5 * 84 * 9675 = 4,063,500 damage.

Obviously this is a problem. It works out fine for MOST of his HP limits. But once he gets below 100 HP, it starts to get broken... Fast. So I wanted to ask if someone can create a diminishing returns script in which it is curved to diminish.

The more damage you deal (depending on level) the less and less you end up dealing in the long run.

Think of a car tied to a very strong bungy rope. You have a small engine, you can go and go and go and you start decelerating to the point where you're not going very fast any longer... 

However, if you have a better engine, you can go much further and can stretch that threshold further, but once it's reached, the car will just go slower and slower the further the car gets.

Is a script like this possible? (FYI I am using the damage core script from Yanfly so I deal more than 9,999 damage. I don't want to make a theoretical cap on damage. But I do want to prevent absurd damage from occurring. )

 
I can't help you with such a script at the moment, but just an idea with your damage formula: why not just stop it from becoming broken by using a "min" function to cap the "injured" multiplier?

(a.tp/20) * a.atk * Math.min((a.mhp / a.hp), 10)

Change the 10 to whatever cap you like.  This means that even at 1HP and full TP, your character would deal a much more reasonable 5 * 12 * 10 = 600 damage.  At level 99, 5 * 84 * 10 = 4200 damage.

I think this would be much more satisfying to the player, too, then having their damage permanently diminish over time.
I didn't even know that function existed. Thanks. That works.

Original thread: https://forums.rpgmakerweb.com/threads/request-dmg-diminishing-returns.53992/