For the most part, you use a Dummy Ability (ability with no effects, but is castable, has mana costs, the correct tooltip, icon, cooldown, targets, etc), then you use triggers to detect when that ability is cast.
Then, you simulate the effect of the ability through triggers, perhaps through other abilities and perhaps solely through triggers.
The action Unit - Damage Target can be used to deal any amount of damage, and since you can retrieve values such as the stats of a hero, this can be used to cause stat-based damage, among other things.