These 4 are the only attack modifiers used by melee heroes in the default game. They have quite some issues when used by ranged units:
  1. They go on cooldown upon projectile hit, instead of launch
  2. Their mana cost is applied upon projectile hit, instead of launch
  3. They fail to save their target and apply to the wrong units when you switch attack targets before projectile impact (this is abusable, as it allows you to target units which you normally cant target, like buildings, wards, allies, and spell immune units)
  4. Due to not saving their target in variables properly, this also means they malfunction when launching 2 projectiles in quick succession (only one of the projectiles will work)
  5. They can ignore silences (this is also an issue on melee users, when silenced during the attack animation, they still apply their effects)

This is all caused by one simple issue:

They are coded using only the OnAttackLanded function. This function triggers when the attack sucessfully hits the target. For ranged heroes, this means on projectile impact.

They should also use the OnAttack function

OnAttack, they should:
  1. Set variables (most importantly, the target of the instance)
  2. Trigger cooldown
  3. Expend mana

Then, OnAttackLanded, they should:
  1. Apply the attack modifier effects, place debuffs and such


Then, OnAttackFail, they should:
  1. If the user is melee, and the attack missed, reset the cooldown, and refund the mana (this is to keep the current behavior with missed attacks not wasting the ability)


Since OnAttack, OnAttackLanded, and OnAttackFail happen all at the same time for melee heroes, the cooldown and manacost reset should not be noticable in-game.

Here are the issues showcased