TIA Info: Skills have a Level 0-6 (I may change the upper limit, but for the sake of simplicity it's 0-6 for now) I want to total the number of Skills for each Level as well as a grand total. (again, I might not use this but it's easy enough to keep for the time being) The code below seems to function down to this line; const level = +values[skillName(field)] || 0; but level is always 0 in the log and it doesn't seem to loop through the other skills. I'm sure there are numerous issues here since I modified an existing bit of code from (hmm, GiGs of course) Any suggestions? Thanks /* Skill Rank Totals */ const skillName = (field) => `${field}`; const skills = [ 'animal_handling', 'crafting', 'endurance', 'healing', 'insight', 'lore', 'manipulation', 'marksmanship', 'melee', 'might', 'move', 'performance', 'scouting', 'sleight_of_hand', 'stealth', 'survival', ]; on( 'change:animal_handling change:crafting change:endurance change:healing change:insight change:lore change:manipulation change:marksmanship change:melee change:might change:move change:performance change:scouting change:sleight_of_hand change:stealth change:survival', (eventInfo) => { clog(`Change Detected: ${eventInfo.sourceAttribute}`); const fields = []; // create an array of the skill names skills.forEach((field) => { fields.push(skillName(`${skills}`)); clog(`field: ${field}`); }); getAttrs(fields, (values) => { clog(`Skills:${skills}`); const output = {}; const statsArray = ['skill_level1', 'skill_level2', 'skill_level3', 'skill_level4', 'skill_level5', 'skill_level6', 'skill_levels']; // loop through statsArray array, rename to match output attribute and set to 0 statsArray.forEach((stat) => { output[`${stat}_total`] = 0; }); // loop through each attribute in the array and grab the value skills.forEach((field) => { const level = +values[skillName(field)] || 0; clog(`Level:${level}`); if (level === 1) { output.skill_level1_total += level; } else if (level === 2) { output.skill_level2_total += level; } else if (level === 3) { output.skill_level3_total += level; } else if (level === 4) { output.skill_level4_total += level; } else if (level === 5) { output.skill_level5_total += level; } else if (level === 6) { output.skill_level6_total += level; } output.skill_levels_total += level; }); setAttrs(output); }); } );