Checking if skill is learnt before damage formula

I am trying to change the attack skill so that if someone has skill x then the normal attack function does (0.001 * a.hp) + (a.atk - b.def), else it just does a.atk - b.def.

Based on some other readings from RPG Maker VX Ace I need to be running a check similar to this:

if $game_actors[a].skills.include?(data_skills[0030]) then (a.hp * 0.001) + (a.atk - b.def) else (a.atk - b.def)

But because I don't know much I can't tell where I'm going wrong. Instead of changing between actors it just deals 0 damage at all times.

Any help would be greatly appreciated.

Original thread: https://forums.rpgmakerweb.com/threads/checking-if-skill-is-learnt-before-damage-formula.49586/