Ok, I've managed to use orb effect to bypass the need to use code.
The logic behind the ability is simple - it steals 5 mana per attack.
Upon successful attack it slaps a buff that does nothing and lasts 60 seconds. It could last for less time, but I use it on a hero who has illusions and since buff-applying is an orb effect, illusions can't do it themselves
View attachment 391094
View attachment 391093
Thank god I've avoided code. Only took me about 6 hours.