I have been working on a piece of code to add "focus" to dice rolls which are smaller than a given threshold. The code below seems to parse through the result of a roll correctly and add focus to any dice that is rolled too low (using 7 as a debug number since I am rolling d6's). The only problem is that the message doesn't go to the chat, even though I don't get any errors in the console and I can get the value of the dice roll and templateStr before and after the addition of focus to the dice roll. Can anyone tell me what is wrong with the code below, even though it is lacking some context for what is going on. sendChat(character.get('name'), templateStr, function(msg) { if(skill.focus != 0) { var focus_left = skill.focus; var cnt = parseInt(skill.training) - 1 + parseInt(attrValue); for(; cnt >= 0; --cnt) { while(msg[0].inlinerolls[0].results.rolls[0].rolls[0][0].results[cnt].v < 7 && focus_left != 0) { msg[0].inlinerolls[0].results.rolls[0].rolls[0][0].results[cnt].v += 1; focus_left -= 1; } if(focus_left == 0) { return; } } } });