I built a few variants of your desired script:
Preamble:
alias "Qdefault" "dota_ability_execute 0"
I did this because it is more readable for me. If you don't want to use that alias you need to change Qdefault
below to dota_ability_execute 0
!
Hero + 3 units in 1 group:
Assumes that you selected your hero + units (in this case 3x familiars) and switches to the first, casts a spell and switches to the next until it reaches to the hero again.
alias "heroAndUnits" "dota_cycle_selected; Qdefault; dota_cycle_selected; Qdefault; dota_cycle_selected; Qdefault; dota_cycle_selected;"
Unit selected
Like the first but starts at the first familiar
alias "unitSelected" "Qdefault; dota_cycle_selected; Qdefault; dota_cycle_selected; Qdefault; dota_cycle_selected;"
Only units
Group of units only
alias "unitsOnly" "Qdefault; dota_cycle_selected; Qdefault; dota_cycle_selected; Qdefault; dota_cycle_selected;"
Manually
This script switches to the next unit and uses a spell. This enables you to time your stuns (chainstun) the enemy.
alias "manually" "dota_cycle_selected; Qdefault"
Final binding
You need to bind any of those aliases (you can have them all in your exec file, aliases wont be executed if not used/binded!)
bind "B" "heroAndUnits"
Afterword:
Those scripts (execpt "manually") assume that the group consist of 3 units. I did not find a way to count the units of a group. Otherwise i may be able to adjust that script a bit.
Extra:
Additionally i wrote a script that lets you cycle through a script from above (in this case heroAndUnits1-4) depending on your unitcount! Feel free to ask me about it since this is pretty advanced.
alias "heroAndUnits1" "dota_cycle_selected; Qdefault; dota_cycle_selected"
alias "heroAndUnits2" "dota_cycle_selected; Qdefault; dota_cycle_selected; Qdefault; dota_cycle_selected"
alias "heroAndUnits3" "dota_cycle_selected; Qdefault; dota_cycle_selected; Qdefault; dota_cycle_selected; Qdefault; dota_cycle_selected;"
alias "heroAndUnits4" "dota_cycle_selected; Qdefault; dota_cycle_selected; Qdefault; dota_cycle_selected; Qdefault; dota_cycle_selected; Qdefault; dota_cycle_selected;"
alias groupSpellToggle "oneUnit"
alias oneUnit "bind B heroAndUnits1; say_team "Script for 1 unit selected"; alias groupSpellToggle twoUnit"
alias twoUnit "bind B heroAndUnits2; say_team "Script for 2 units selected"; alias groupSpellToggle threeUnit"
alias threeUnit "bind B heroAndUnits3; say_team "Script for 3 units selected"; alias groupSpellToggle fourUnit"
alias fourUnit "bind B heroAndUnits4; say_team "Script for 4 units selected"; alias groupSpellToggle oneUnit"
bind "N" groupSpellToggle
Pressing N in this case cycles through heroAndUnits1-4 and then back to 1.
Each cycle rebinds "B" (you can change this if you want) to execute the groupspell.
To realize which number is currently active as a user i added a say_team
which is a normal ingame-chat to your teammates.
Best Answer
Moment of Courage can proc during Duel
Duel applies the Taunted status to both Legion Commander and her target, which combines a Silence (cannot manually activate abilities), a Mute (cannot manually activate items), and forces the unit to attack a specific target. Nothing about a Duel disables the passive effects of abilities of items, so Moment of Courage can proc during a Duel.
That said, Overwhelming Odds and Press the Attack are more useful to guarantee a Duel victory in the early game.
Overwhelming Odds is a potentially very strong AoE nuke that boosts Legion Commander's movement speed, allowing her to get in range for a followup Duel.
Press the Attack offers huge utility thanks to its ability to be cast on allies, in cases where a strong dispel can mean the difference between life and death. At the same time, increased attack speed and health regen will make it more likely to win a Duel. As of patch 7.20, winning a duel will automatically activate the effects of Press the Attack on Legion Commander, so levelling up this skill early will provide a nice chunk of regen after every Duel win.
Moment of Courage, on the other hand, will proc depending on the target's attack speed. Early on, Legion Commander wants to Duel squishy targets that don't deal much damage, and have low attack speed. This makes it unlikely to even get a single proc of Moment of Courage during the entirety of a Duel.