Ok, what if you make it a whole string?

#3 = /castsequence reset=4 Chain Lightning, Elemental Mastery, Lava Burst, null
#4 = /castsequence reset=4 ,,,,,,,Chain Lightning,,,,,,,,,,
#5 = /castsequence reset=4 ,,,,,,,Lava Burst,,,,,,,,,,

Commas adjusted accordingly and all that.