Damage formula for low stat based attack

I am trying to create a skill that deals more damage the lower a stat is. I will use speed as my example.


Currently I have created a formula in the damage section but it does not work. I will explain more after you see the formula:


(-a.agi) + 100 * 14 


Now the problem here is the highest this stat in my game can ever go is 100, so I thought up the idea to


make the speed stat negative in the formula and in theory it would work, however the issue is just putting


the negative sign in front of a value like speed doesn't work in the formula code (it doesn't change it to a negative value).


So how could I either make the value negative for the mathematics to work out or what is another formula


that would work?
You need to mathematically reorder the formula into something where the - is an operation instead of a sign.


However, I think you mistyped the formula as well - because the formula you places there has the same result as (1400 - a.agi), which means with stats below 100 it will always do above 1300 damage. But that would be a correct reorder - you just need a value in front of the -
(-a.agi) + 100 * 14 

Simple math. Multiplications are done before addition and subtractions.


Why not simply do (100 - a.agi) * 14 ?

Original thread: https://forums.rpgmakerweb.com/threads/damage-formula-for-low-stat-based-attack.58566/