Thank you so much, everyone! With that, I managed to put everything together and make it work - I could probably polish up the presentation some more, but as far as the puzzle of making it functional, I'm satisfied. The complete macro is as follows: magic-missile &{template:default} {{name=Magic Missile
}} {{=Number of missiles: ?{spell level|1,3|2,4|3,5|4,6|5,7|6,8|7,9|8,10|9,11}
[First target](`/w gm %{@{character_name}|mmrange?{spell level}} [[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]] %{@{character_name}|mm-follow}[[ [[1]] ]] {{Left=[[?{spell level}-?{missiles to target}]]}} {{[[[{0,?{missiles to target}}>?{spell level}]]](#)= [Results](`/ooc &{template:default} {{name=Magic Missile: results}} {{[1](#)=[[?{missiles to target}d4+?{missiles to target}]]}}) }} {{[0](#)=}})}} mm-follow &{template:default} {{name=Magic Missile
}} {{Missiles=[[ [[?{missiles to target}]] ]]
}} {{[1](#)=[Next target](`/w gm %{@{character_name}|mmrange$[[13]]} {{storage= [[$[[1]]]][[$[[2]]]][[$[[3]]]][[$[[4]]]][[$[[5]]]][[$[[6]]]][[$[[7]]]][[$[[8]]]][[$[[9]]]][[$[[10]]]][[$[[11]]]]}} %{@{character_name}|mm-follow}[[$[[12]]+1]][[$[[13]]-?{missiles to target}]]{{[[[{0,?{missiles to target}}>$[[13]]]]](#)= [Results](`/ooc &{template:default} {{name=Magic Missile: results}} {{[1](#)=[[$[[2]]d4+$[[2]]]]}} {{[[[{$[[12]]-9,1}kh1]]](#)=[[$[[3]]d4+$[[3]]]]}} {{[[[{$[[12]]-8,1}kh1]]](#)=[[$[[4]]d4+$[[4]]]]}} {{[[[{$[[12]]-7,1}kh1]]](#)=[[$[[5]]d4+$[[5]]]]}} {{[[[{$[[12]]-6,1}kh1]]](#)=[[$[[6]]d4+$[[6]]]]}} {{[[[{$[[12]]-5,1}kh1]]](#)=[[$[[7]]d4+$[[7]]]]}} {{[[[{$[[12]]-4,1}kh1]]](#)=[[$[[8]]d4+$[[8]]]]}} {{[[[{$[[12]]-3,1}kh1]]](#)=[[$[[9]]d4+$[[9]]]]}} {{[[[{$[[12]]-2,1}kh1]]](#)=[[$[[10]]d4+$[[10]]]]}} {{[[[{$[[12]]-1,1}kh1]]](#)=[[$[[11]]d4+$[[11]]]]}} {{[[[{$[[12]],1}kh1]]](#)=[[$[[13]]d4+$[[13]]]]}} ) }} {{[0](#)=}})
}} {{Count=$[[12]]
}} {{Left=$[[13]]
}} mmrange X ?{missiles to target|X|...|1}