Put all 12 abilities in the unit's spell list in the Object Editor.
-
Set QSkill[1] = Firebolt
-
Set QSkill[2] = Storm Bolt
-
Set QSkill[3] = Shadow Strike
-
Set WSkill[1] = Whatever
-
Set WSkill[2] = Whatever Else
-
Set WSkill[3] = Third W Option
-
-------- same for E and R --------
-
Events
-

Unit - A unit learns a skill
-
Conditions
-
Actions
-

Set LEARNED = (Learned hero skill)
-
-------- check Q skills --------
-

For each (Integer A) from 1 to 3 do (Actions)
-


Loop - Actions
-



If (All conditions are true) then do (Then actions) else do (Else actions)
-




If - Conditions
-





LEARNED equal to QSkill[(Integer A)]
-




Then - Actions
-





For each (Integer B) from 1 to 3 do (Actions)
-






Loop - Actions
-







If (All conditions are true) then do (Then actions) else do (Else actions)
-








If - Conditions
-









LEARNED Not equal to QSkill[(Integer B)]
-








Then - Actions
-









Unit - For (Triggering unit), Ability QSkill[(Integer B)], Disable ability: True, Hide UI: True
-








Else - Actions
-





Custom script: exitwhen true //leave loop early since we did what we needed to do
-




Else - Actions
-

-------- check W skills --------
-

For each (Integer A) from 1 to 3 do (Actions)
-


Loop - Actions
-



If (All conditions are true) then do (Then actions) else do (Else actions)
-




If - Conditions
-





LEARNED equal to WSkill[(Integer A)]
-




Then - Actions
-





For each (Integer B) from 1 to 3 do (Actions)
-






Loop - Actions
-







If (All conditions are true) then do (Then actions) else do (Else actions)
-








If - Conditions
-









LEARNED Not equal to WSkill[(Integer B)]
-








Then - Actions
-









Unit - For (Triggering unit), Ability WSkill[(Integer B)], Disable ability: True, Hide UI: True
-








Else - Actions
-





Custom script: exitwhen true
-




Else - Actions
-

-------- check E skills --------
-

For each (Integer A) from 1 to 3 do (Actions)
-


Loop - Actions
-



If (All conditions are true) then do (Then actions) else do (Else actions)
-




If - Conditions
-





LEARNED equal to ESkill[(Integer A)]
-




Then - Actions
-





For each (Integer B) from 1 to 3 do (Actions)
-






Loop - Actions
-







If (All conditions are true) then do (Then actions) else do (Else actions)
-








If - Conditions
-









LEARNED Not equal to ESkill[(Integer B)]
-








Then - Actions
-









Unit - For (Triggering unit), Ability ESkill[(Integer B)], Disable ability: True, Hide UI: True
-








Else - Actions
-





Custom script: exitwhen true
-




Else - Actions
-

-------- check R skills --------
-

For each (Integer A) from 1 to 3 do (Actions)
-


Loop - Actions
-



If (All conditions are true) then do (Then actions) else do (Else actions)
-




If - Conditions
-





LEARNED equal to RSkill[(Integer A)]
-




Then - Actions
-





For each (Integer B) from 1 to 3 do (Actions)
-






Loop - Actions
-







If (All conditions are true) then do (Then actions) else do (Else actions)
-








If - Conditions
-









LEARNED Not equal to RSkill[(Integer B)]
-








Then - Actions
-









Unit - For (Triggering unit), Ability RSkill[(Integer B)], Disable ability: True, Hide UI: True
-








Else - Actions
-





Custom script: exitwhen true
-




Else - Actions
You could use a single array for all the hero skills (Skill[1] through Skill[12]) if you wanted and compact the trigger:
-
Events
-

Unit - A unit learns a skill
-
Conditions
-
Actions
-

Set LEARNED = (Learned hero skill)
-

For each (Integer A) from 1 to 12 do (Actions)
-


Loop - Actions
-



If (All conditions are true) then do (Then actions) else do (Else actions)
-




If - Conditions
-





LEARNED equal to Skill[(Integer A)]
-




Then - Actions
-





Set START = ((Integer A) - 1) //subtraction, then integer division, and then multiplication; order matters here
-





Set START = (START / 3)
-





Set START = (START x 3)
-





Set START = (START + 1)
-





For each (Integer B) from START to (START + 2) do (Actions)
-






Loop - Actions
-







If (All conditions are true) then do (Then actions) else do (Else actions)
-








If - Conditions
-









LEARNED Not equal to Skill[(Integer B)]
-








Then - Actions
-









Unit - For (Triggering unit), Ability Skill[(Integer B)], Disable ability: True, Hide UI: True
-








Else - Actions
-





Custom script: exitwhen true //leave loop early since we did what we needed to do
-




Else - Actions
This will try to disable all the other Q skills every time a Q skill is leveled up. That shouldn't matter for performance, since the check is relatively uncommon and not resource-intensive.