As you mentioned, if the defense is high enough, the 10 isn't enough to offset the final number. Using your stats, if we have: 10 + (21 * 1.15 - 42), then we get 10 + (24.15 - 42), which is 10 + (-17.85) which is -7.85, which ultimately is less than 0, so 0 damage.

Instead, if we do:

Code:

`const damage = 10 + (a.atk * 1.15 - b.def); damage < 10 ? 10 : damage;`

We create a formula that says, "If 10 + (a.atk * 1.15 - b.def) is less than 10, then do 10 damage. Otherwise, do the result of the formula."

So try using an inline ternary as mentioned above.

A ternary is a conditional statement that takes three expressions:

1. An expression that evaluates to either true or false

2. A statement that will run if 1 evaluates to true

3. A statement that will run if 1 evaluates to false

And it's written as 1 ? 2 : 3. So if 1 is true, run statement 2, otherwise, run 3. So what we do is say, "Take the number generated by running 10 + (a.atk * 1.15 - b.def)", then say, "If the resulting number is less than 10" (true), "use the number 10" (2), otherwise (false), "use the resulting number".