I wanted to create a skill that deals damage that can be reduced by the enemy's defense, but if the user is faster than the enemy, the damage ignores their defense. Below is what I have so far, but it deals 0 damage on enemies that are slower than me, although it seems to work on enemies that are faster than me.
Code:
a.agi > b.agi ? 50 + (0.4*a.atk)*(0.8*a.agi) : (50 + ((0.4*a.atk)*(0.8*a.agi)) / b.def