Nick Olivo wrote the following code: on("chat:message", function(msg) { if (msg.type == "api" && msg.content.indexOf("!customSpellbook") == 0){ var args = msg.content.split(/\s+/); var spellName = args[1].toLowerCase(); var spellLevel = Number(args[2]); var tokenid = msg.selected[0]._id; var token = getObj("graphic",tokenid); var charID = token.get("represents"); var tokenName = token.get("name"); switch(spellName){ case "magicmissile": magicMissile(spellLevel); break; case "scorchingray": scorchingRay(spellLevel,tokenName); break; } sendChat("API",`!modbattr --charid ${charID} --lvl${spellLevel}_slots_expended|-1`); } }); function magicMissile(spellLevel){ var numberOfDarts = spellLevel + 2; var dartOutput = ""; for(counter=1;counter<=numberOfDarts;counter++){ dartOutput+=`{{Dart ${counter} = [[1d4+1]]}}`; } var outputMessage = `&{template:default} {{name=Magic Missile}} ${dartOutput}`; sendChat("API",outputMessage); } function scorchingRay(spellLevel,tokenName){ var numberOfRays = 3 + (spellLevel-2); var rayOutput = ""; if(spellLevel<2){ sendChat("CustomSpellbook","Scorching Ray requires at least a level 2 spell slot"); return; } for (counter=1;counter<=numberOfRays;counter++){ rayOutput+=`{{Ray ${counter} Attack [[1d20+@{${tokenName}|spell_attack_bonus} ]]=[[2d6]] Fire Damage}}`; } var outputMessage = `&{template:default} {{name=Scorching Ray}} ${rayOutput}`; sendChat("API",outputMessage); } I am trying to add a spell to this custom spell book. I am trying to add Cure Wounds with the disciple of life modifier. I have added the function and the appropriate case to his code. It is not working. Any ideas? CASE added under the switch section case "CureWoundsDL": CureWoundsDL(spellLevel); break; this function added at the end of his code: function CureWoundsDL(spellLevel){ var HealOutput=""; HealOutput+=`{{Healing=[[${spellLevel}d8+2+${spellLevel}]]}}`; var outputMessage = `&{template:default} {{name=Cure Wounds - Disciple of Life}} ${HealOutput}`; sendChat("API",outputMessage); }