Damage Formula Help

I've been trying out different formulas lately but for some reason, it isn't working out for me.
I'm still new to damage formulas so I probably have made a mistake.

This is the formula I made;

damage = (Math.sqrt(a.atk * 2) / Math.sqrt(b.def * 4)) {
if (a.isStateAffected(17)) { damage *= 1.4 }
if (a.atk === 99) { damage *= >=2 && <=10 }
if (damage <= 0) { damage = 1 }
}

What I'm trying to do is √(attack stats of attacker * 2), then I divide it with √(defense stats of defender * 4)
This will be the base power for the skill represented by this

damage = (Math.sqrt(a.atk * 2) / Math.sqrt(b.def * 4))

Then the formula would consider whether or the attack stat for the attacker is doubled (that would be indicated by status number 17 which is Atk Up), if so then the base attack would be multiplied by 1.4, which is represented by this

if (a.isStateAffected(17)) { damage *= 1.4 }

Then if the formula would check if the attackers atk stats is 99 (which is the maximum in the game), if so then the attack would be multiplied between 2 up to 10.

if (a.atk === 99) { damage *= >=2 && <=10 }

And finally, the formula would check whether the total attack is 0, if so the damage becomes 1

if (damage <= 0) { damage = 1 }

This is what I had planned but then every time I tried it out, the damage total is 0
I feel like I'm doing something wrong but I can't figure out what exactly?
What do you think I should change?
1) a damage formula needs to be a single line, and that means you need to separate the commands by ; where needed. They are missing from your formula.

2) a damage formula needs to be a mathematical or logical formula, " damage *= >=2 && <=10 " is simply nonsense.

3) you need to make the formula as short as possible to fit, so the first part should be
Code:
dam = math.sqrt(a.atk/(2*b.def));
2) a damage formula needs to be a mathematical or logical formula, " damage *= >=2 && <=10 " is simply nonsense.

2. You're right but is there a way in order to implement it since I was hoping the base power be multiplied at a random number that doesn't exceed 10

3) you need to make the formula as short as possible to fit, so the first part should be
Code:
dam = math.sqrt(a.atk/(2*b.def));

3. Alright, Thank you

Original thread: https://forums.rpgmakerweb.com/threads/damage-formula-help.131694/