If you're on an older patch, your best bet is to probably trigger the mana flare effect yourself. For example, you'd want to check when your spell is cast, enumerate any units nearby that have the Mana Flare buff, and then create the lightning effect + apply damage.
I have a sample map below that is tweaked to work pretty accurately (using patch 1.26). I've edited the archmage's "summon water elemental" to cost 20% of the unit's max mana. The triggers are shown below, but I've left out the "TimedLightningBetweenUnits" trigger as it is pretty long:
-
Water Elemental Cast
-

Events
-


Unit - A unit Begins casting an ability
-

Conditions
-


(Ability being cast) Equal to Summon Water Elemental
-

Actions
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Percentage mana of (Triggering unit)) Greater than or equal to 20.00
-



Then - Actions
-




Unit - Set mana of (Triggering unit) to ((Percentage mana of (Triggering unit)) - 20.00)%
-



Else - Actions
-




Unit - Pause (Triggering unit)
-




Unit - Order (Triggering unit) to Stop
-




Unit - Unpause (Triggering unit)
-




Custom script: call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0, 0, 5, "|cffffcc00Not enough mana.|r")
-




Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
-




Sound - Play Error <gen>
-




Custom script: endif
-
Water Elemental Effect
-

Events
-


Unit - A unit Starts the effect of an ability
-

Conditions
-


(Ability being cast) Equal to Summon Water Elemental
-

Actions
-


Set CasterPosition = (Position of (Triggering unit))
-


Set ManaFlareGroup = (Units within 750.00 of CasterPosition matching ((((Matching unit) has buff Mana Flare) Equal to True) and (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True)))
-


Custom script: set udg_ManaFlareUnit = FirstOfGroup(udg_ManaFlareGroup)
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




ManaFlareUnit Not equal to No unit
-



Then - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






((Triggering unit) is A Hero) Equal to True
-





Then - Actions
-






Set ManaFlareDamage = (Min(((Max mana of (Triggering unit)) x 0.20), 50.00))
-





Else - Actions
-






Set ManaFlareDamage = (Min((((Max mana of (Triggering unit)) x 0.20) x 3.00), 90.00))
-




Unit - Cause ManaFlareUnit to damage (Triggering unit), dealing ManaFlareDamage damage of attack type Spells and damage type Magic
-




Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Human\ManaFlare\ManaFlareBoltImpact.mdl
-




Special Effect - Destroy (Last created special effect)
-




Set TimedLightning_SourceUnit = ManaFlareUnit
-




Set TimedLightning_TargetUnit = (Triggering unit)
-




Set TimedLightning_LightningType = Mana Flare
-




Set TimedLightning_Duration = 1.00
-




Trigger - Run TimedLightningBetweenUnits <gen> (ignoring conditions)
-



Else - Actions
-


Custom script: call RemoveLocation(udg_CasterPosition)
-


Custom script: call DestroyGroup(udg_ManaFlareGroup)
If you want to import it into your map:
- First, in the editor, go to File > Preferences > Checkmark "Automatically create unknown variables while pasting trigger data"
- Copy the Timed Lightning folder and paste it in your map
- Copy the Sample Spell and paste it in your map
- Change the water elemental triggers as needed, i.e. change the conditions and change the "ManaFlareDamage" as needed. It is currently using the default damage caps in the object editor
If you end up having multiple spells like this, it might make sense to extract the mana flare logic into its own trigger that you can run. Hopefully this helps you get a start on it!