First of all, you have to know where the mouse is.
With sharpcraft you can get the mouse on screen or on location (dunno which)
on location would be perfect as it is exactly the location you want.
on screen might be a bit inaccurate because of terrain height but you can calculate it with camera angle, height, field of fiew, distance, rotation and position
You can also try to do it with trackables but I dont recommend that.
So now that we have stated that that is impossible (in normal WC3), we can safely say that it is impossible.
When having a hacked WC3 (everyone in the game) aka SharpCraft, you can create a dummy and let it follow the unit and face the mouse.
Now there is problem no.2:
How do you know when a unit is targeting something?
There is none... unless you use placeholde abilities that are instant cast and when you are ordered to cast it, you re-order the caster to continue his last action and then you replace that ability and force UI to select it.
After that, you have that state... but how do you check when the player leaves that state?
1. by activating spell.
2. by pressing esc.
3. by right clicking on the map.
all can be done but you have to be carefull and make a big mess of triggers.
Now if you managed to do that properly, you also have to make it dynamic to make all spell types go into your system:
Point target spells.
Direction target spells.
Object target spells.
Direction target spells with dynamic maximum distance.
etc etc etc
I think we can safely say that it is a big hell of work that has to be done to make it.