Is it if the unit with the ability is attacked, or if the unit with the ability attacks? Either way, when you mean attack, do you mean when the animation starts, or when the attack connects? If you use 'A unit is attacked' this even fires when the attack animation begins, not when damage is applied. If you wish to have the latter, you will need a DDS. I recommend Bribe's Damage Engine for that.
Once you have decided, either use 'A unit is attacked' or 'DamageEvent equals to 1.00', as the actions do Set level of ability [your ability] to [level of the ability] + 1.