I've been thinking how to best come up with a functional process for this mod considering how using a projectiles / units vector is far from ideal. Then it hit me...
Location, location, location!
Use the projectiles point of impact relative to the offset position of the unit.
What the hell does this mean you say?
Obviously we'll use the point of impact of the projectile in comparison to the units position. However the units position should be offset by (a negative) amount of the size of the units hit box. Should the projectile impact within 1/2 the width of the units hitbox we can say that the projectile impacted the rear of the unit.
This process would be very quick and thus only requires major modifications to projectile.lua to ensure that the projectiles point of impact is passed the he unit. The unit would make the determination / comparison via its default units.lua \ OnDamage event.
Best of all this would work with splash damage too!
Reisn