So to start with, the script is supposed to allow me to shift-click to select multiple tokens then have them all roll a saving throw against a dc and type by putting this command in chat: !savevsdc [Savetype] [DC] Ive been testing it with 1 Barlgura, 1 Unicorn, 3 Quaggoths, and 1 Water Weird. Its perfectly formatted as I want it to be, but the bonus to the rolls only uses the ability score modifier despite the save I tested it with the Barlgura was proficient. (Also, I know the Unicorn is supposed to have advantage on the save but honestly Im just gonna be happy if it can show the correct bonus). Im using 5e, Jumpgate, and I set the API sandbox to Experimental if any of that makes a difference. Please help me fix the bonuses if possible. Anyways here is the script: on('ready', function () { on('chat:message', function (msg) { if (msg.type === 'api' && msg.content.startsWith('!savevsdc')) { const args = msg.content.split(' '); const saveType = args[1]; const dc = parseInt(args[2]); if (!saveType || isNaN(dc)) { sendChat('System', 'Usage: !savevsdc [SaveType] [DC]'); return; } if (!msg.selected || msg.selected.length === 0) { sendChat('System', 'Please select one or more tokens.'); return; } const results = {}; const lowerSaveType = saveType.toLowerCase(); _.each(msg.selected, function (sel) { const token = getObj('graphic', sel._id); if (!token) return; const characterId = token.get('represents'); if (!characterId) return; const name = token.get('name') || 'Unknown Creature'; const attr = findObjs({ type: 'attribute', characterid: characterId, name: `${lowerSaveType}_save_bonus` })[0]; const bonus = parseInt(attr?.get('current')) || 0; const roll = randomInteger(20); const total = roll + bonus; const success = total >= dc; if (!results[name]) results[name] = []; results[name].push({ roll, bonus, total, success }); }); let output = `<div style="text-align:center;"><b>${saveType.toUpperCase()} - DC ${dc}</b></div><br><br>`; for (let name in results) { const rolls = results[name]; let successCount = 0; let failCount = 0; output += `<div style="text-align:center;"><b><span style="color:gold;">${name}</span></b></div><br>`; output += `<table style="border-collapse: collapse; margin-left: auto; margin-right: auto;">`; output += `<tr><th style="border: 1px solid black; padding: 4px;">Roll</th><th style="border: 1px solid black; padding: 4px;">Bonus</th><th style="border: 1px solid black; padding: 4px;">Total</th><th style="border: 1px solid black; padding: 4px;">Result</th></tr>`; rolls.forEach(r => { const resultText = r.success ? '<span style="color:green;"><b>Success</b></span>' : '<span style="color:red;"><b>Failure</b></span>'; if (r.success) successCount++; else failCount++; output += `<tr><td style="border: 1px solid black; padding: 4px; text-align: center;">${r.roll}</td><td style="border: 1px solid black; padding: 4px; text-align: center;">${r.bonus}</td><td style="border: 1px solid black; padding: 4px; text-align: center;">${r.total}</td><td style="border: 1px solid black; padding: 4px; text-align: center;">${resultText}</td></tr>`; }); output += `</table><br>`; output += `<table style="border-collapse: collapse; margin-left: auto; margin-right: auto;">`; output += `<tr><th style="border: 1px solid black; padding: 4px;">Total Successes</th><th style="border: 1px solid black; padding: 4px;">Total Failures</th></tr>`; output += `<tr><td style="border: 1px solid black; padding: 4px; text-align: center;">${successCount}</td><td style="border: 1px solid black; padding: 4px; text-align: center;">${failCount}</td></tr>`; output += `</table><br><br>`; } sendChat('Saving Throws', output); } }); });