Try adding something like:
before the
The 2 falses are kinda of buggy - some combinations will make the function not deal any damage. I believe the first one has something to do with the damage being blocked, while the other one is whether the attack is ranged or not. I dont really know much about their uses.
JASS:
if a < 0 then
set a = 1
endif
call UnitDamageTarget(dat.orb[i], dat.target[i], a, false, false, null, null, null)
The 2 falses are kinda of buggy - some combinations will make the function not deal any damage. I believe the first one has something to do with the damage being blocked, while the other one is whether the attack is ranged or not. I dont really know much about their uses.