When u attack with a spell, i dont think it goes to the category "attacking unit", spells are always referred "casting unit".
Anyway, well, good that u clarify it, u didnt say in ur first post that it doesnt always hit. In that case qwertys idea about the buff check is good. U should make a trigger that has event like "every 0.5 sec of game time" and the trigger checks for buffs and turns the units with the wanted buff into a unit u want.
If u have a problem creating that trigger, post here, then i'll check the editor to see how it could be made.