Another of those things that I've been trying to figure out on my own, but can't quite grasp. (I'm a writer, not a coder.

)
So I managed to get healing spells to work fine in my game, but now I'm trying to integrate attack spells. I only have one to test with, and everything I've done to try to get it to work has pretty much failed. I've tried setting up the custom command to include 'cast #text# on #object#' and it just brings up a list of everything in the room, which I don't want. If I remove the 'on #object#' part, it just errors. I've tried switch commands embedded in it, changing the names of the target objects, creating attributes for the spell to target, and other things too numerous to remember. Nothing's worked.
I just want to be able to cast the spell 'Luna Flare' on an enemy object, recognize there IS an enemy object to be targeted, and carry out the effects intended. Here's a screenshot of what I've got of it so far, as well as the game file and accompanying library. Can anyone explain where I've gone wrong this time, please? Thanks much.

The attempted embedded switch scripting to target specific objects.

The custom command itself.