Depends, if this is
A: Versus players
The hard way then, you need to remove the target unit's controlling from owner of that unit, then make loop. For each integer A from 1 to Maximum time you want. Do: unit, issue order targeting a point (Issue target unit of ability being cast) to move to point with polar offset, unit position of target unit of ability being cast offset by 500 towards angle from position of casting unit to position of target unit of ability being cast.
Casting unit damage target unit of ability being cast for 100 damage.
Wait 1.00 seconds.
B: Versus computer
Then this is easy, you can make it by creating a dummyspell that casts a spell at targeted enemy, spell cast this way should be silence, which has all it's "Turns off spellcasting/ranged attack etc.." options checked. The enemy can't do anything but move so it'll act just like against invulnerable unit: Running away. Then you need to do trigger that deals damage to all units that have the debuff the 'silence' gives.