I'm not sure what you mean by "nesting" in this case... I tend to think of nesting as when one macro is used inside another. Are you referring to the fact that you need the script call to operate inside your query? ChatSetAttr-only Option ChatSetAttr offers a way to run even in a non-script message (like this one currently is) by wrapping the CSA command line in: ! ... !!! CSA will listen to all messages and scan for this formation. If CSA finds this text pattern with a CSA handle (like setattr, delattr, etc.), it runs the command. When you do this (embed a CSA command in a non-script message), CSA doesn't have the time to remove the detected text from the command line before the message gets rendered to chat (it runs in "parallel"), so typically you would want to put your embedded command between template parts so that it won't show, anyway: &{template:simple}{{name=@{character name} Cast Check}} !setattr --sel --mana|-[[1d4]] !!! {{text=?{Spell List|... There, the command is between the template parts, but not part of the query. If there will be a different mana cost for each spell, you might need to include the ChatSetAttr call as a part of the query, but still between template parts. That would mean that the query would encompass at least the opening of the template part "text": &{template:simple}{{name=@{character name} Cast Check}} ?{Spell List | @{Spell1Name}, !setattr --sel --mana|-[[1d4]] !!! {{text=... | @{Spell2Name},!setattr --sel --mana|-[[1d4+1]] !!! {{text=... | ... } }} I believe you can also include whole template parts as the value of the adjustment, and CSA will use the first inline roll as the amount to do the modification while leaving the template part behind, so that might be an option, as well. Not sure. You'd have to play with having the query completely wrap the {{text}} template part (which will be made ugly with HTML replacements), and placing the query in an argument of the CSA line with the mana adjustment being first (before the template part in the query option) if it would even work: &{template:simple}{{name=@{character name} Cast Check}} !setattr --sel ?{Spell List |--mana&pipe;-[[1d4]] {{text= @{Spell1Name},[[d20+@{selected|Spell1HitMod}@{MenMod}+?{Modifier|0} [@{Spell1Name}_Cast] ]] **@{Spell1Name}** Mana Drain: **@{Spell1Drain}** Area: **@{Spell1Area}** Magic Actions: **@{Spell1Act}** }} |...} !!! I'm not even sure if that will work, but it might be possible with some careful attention to HTML replacements. It would also be a bit difficult to edit/update later, as you'd have to first parse your way through all of the embedded-ness, through all of the HTML replacements-es, and then do the same replacement-izing to your new text to make sure it will work. Of course, there might be a way to do this with metascripts and make the whole thing (somewhat) more readable. Let me know if you're open to that sort of option and I'll see if I can work it up for you.