This is the most I could do. The values showed up in the debug log, but I couldn't manage to pass the duration or direction attribute to the new spells after being added. The added code is bolded (meh). handleSpellCast = function(msg) { if (debug) { log('Handle Spell Cast') log(msg) } let status = state[combatState].config.status; let concentration = state[combatState].config.concentration; let spellName let description let concentrate = false let spellLevel let duration let durationmult let direction if (status.sheet == 'OGL') { spellName = msg.content.match(/name=([^\n{}]*[^"\n{}])/); spellName = RegExp.$1; description = msg.content.match(/description=([^\n{}]*[^"\n{}])/) description = RegExp.$1; spellLevel = msg.content.match(/spelllevel=([^\n{}]*[^"\n{}])/) spellLevel = RegExp.$1; if (msg.content.includes("{{concentration=1}}")) { concentrate = true } if (!spellLevel && !concentrate) { return; } } else if (status.sheet == 'Shaped') { spellName = msg.content.match(/title=([^\n{}]*[^"\n{}])/); spellName = RegExp.$1; description = msg.content.match(/{{content=([^\n{}]*[^"\n{}])/); description = RegExp.$1; duration = msg.content.match(/{{duration=.*([^\n{}]\d{1,2})_{1}([A-Z]*)[^"\n{}@][}$]/); duration = RegExp.$1; durationmult = RegExp.$2; if (durationmult.includes("ROUND")) { durationmult = 1 } else if (durationmult.includes("MINUTE")) { durationmult = 10 } else { durationmult = 0 //ONLY ACCOUNT FOR ROUND AND MINUTE DURATIONS, EVERYTHING ELSE IS 0 } if (durationmult == 0) { duration = 1 } else { duration = (duration * durationmult); } if (msg.content.includes("CONCENTRATION")) { concentrate = true } } else if (status.sheet == 'PF2') { spellName = msg.content.match(/header=([^\n{}]*[^"\n{}])/); spellName = RegExp.$1; description = msg.content.match(/desc=([^\n{}]*[^"\n{}])/) description = RegExp.$1; } if (!spellName) { return } if (debug) { log('Spell Name:'+spellName) log('Description:'+description) log('Concentrate:'+concentrate) log('Duration:'+duration) log('Duration Multiplier:'+durationmult) } if (!description) { description = 'None' } if (status.autoAddSpells) { let key = spellName.toLowerCase() let condition = getConditionByKey(key) if (duration >= 1) { direction = -1 } else { direction = 0 } if (typeof condition == 'undefined' && !getIgnoresByKey(key)) { state[combatState].spells[key] = { name: spellName, key: key, type: 'Spell', icon: 'red', iconType: 'Combat Master', description: description, duration: duration , direction: direction , message: 'None', targeted: false, favorite: false, concentration: concentrate, description: description, addAPI: 'None', addRoll20AM: 'None', addFX: 'None', addMacro: 'None', addPersistentMacro: false, remAPI: 'None', remRoll20AM: 'None', remFX: 'None', remMacro: 'None'