So you need that X set to the Hero's damage he deals? And do you know that damage is often random?
There's no certain way.
But the idea of seeing how much damage the hero often does, and storing that damage to a variable to use in the spell, is pretty suitable.
Maybe you could use Mirror Image ability - set Data - Damage dealt to 100%
Then you force the hero to cast Mirror Image ability to create his clone, then you teleport his clone to the target of the spell, and order him to attack?