I tried to be smart and use a beneficial spell like Rejuvenation with enemy targeting, but even that causes them to wake up, so it might just not be Channel but some hard coded shenanigans at play
The reason why that happens is because any time a unit starts the effect of an ability on an enemy the target of the ability takes 0.00 damage.
I tried to bypass that by ordering the enemy unit to stop and then calling on it
Doc - UnitAddSleep (even with a delay after it wakes up) but it did not seem to do anything - seems the unit's hardcoded behavior is to remain awake as long as it has enemy nearby it can attack.
One possible way to solve this is to use Channel's 'Casting Time' field. When unit is channeling the spell, it does not yet wake the target. So possibly, instead of having this event:
-
Unit - A unit Starts the effect of an ability
You set the 'Casting Time' to have same value as your 'Follow through Time' and detect start of the spell via event
-
Unit - A unit Begins channeling an ability
and finally, stop the unit's actual cast of the ability (which would wake the target) using
-
Begin Cast
-

Events
-


Unit - A unit Begins casting an ability
-

Conditions
-

Actions
-


Unit - Order (Triggering unit) to Stop.
The issue with this approach is I think only a single one - if the spell requires mana and unit loses that mana (i.e. via mana burn, etc.) then it immediately stops channeling the spell.
As you wrote, you need to manage mana removal and cooldown yourself.
Second approach I could think of is a bit more convoluted. You create two versions of your ability - one requires unit target and second is set to require no target (i.e. it is instant cast).
The targeting spell is a dummy spell, the instant cast is the actual spell.
Give both spell to your unit, but hide the instant-cast version.
Detect start of cast of the targeting/dummy ability via 'Beings channeling' event, hide the dummy/targeting ability, show the actual/instant one and issue the caster an order with no target - to cast the actual spell.
Use an event 'Unit stops casting an ability' to detect when the instant version has been stopped, hide it and show back the dummy/targeting version of the ability.
While with this approach you don't need to care for mana like in the previous option, you still need to manage cooldown on your own. It is also a bit more complicated because you need to keep track of the target of the ability.
Edit:
After writing my post, I've found out that the following seems to work just OK - the unit continued on sleeping:
-
Untitled Trigger 001
-

Events
-


Unit - A unit About to take damage
-

Conditions
-


((Triggering unit) is sleeping) Equal to True
-

Actions
-


Custom script: if GetEventDamage() < 0.001 then
-


Set VariableSet sleepingUnit = (Triggering unit)
-


Unit - Pause sleepingUnit
-


Custom script: endif
-
Untitled Trigger 002
-

Events
-


Unit - A unit Takes damage
-

Conditions
-


(Triggering unit) Equal to sleepingUnit
-

Actions
-


Unit - Unpause sleepingUnit