Okay, I have a solution for you. You have to do two things in preparation. First, change your selects to remove the value= part from the options, like this: <select name="attr_skillcomp" id="skillcomp"> <option>Cursed</option> <option>Flawed</option> <option selected>Average</option> <option>Trained</option> <option>Exceptional</option> <option>Master</option> <option>Legendary</option> </select> If you dont put a value in the options, it just uses the text as the option value. Secondly, check if your sheet has a script block. It's a section of code in the html file that starts <script type="text/worker"> and ends </script> If your sheet doesnt have that, add a script block at the end of your html, like this: <script type="text/worker">
</script> Now, copy all of the code below and paste it into your html just after the first line of the script block. Dont worry about its complexity. You dont need to edit it. And your proficiency values should now update automatically, whenever you change level or any of the dropdowns. const table_proficiencies = { '0.25': {Cursed: -2, Flawed: -1, Average: 0, Trained: 0, Exceptional: 0, Master: 1, Legendary: 2 }, '0.5': {Cursed: -2, Flawed: -1, Average: 0, Trained: 0, Exceptional: 1, Master: 2, Legendary: 3 }, '1': { Cursed: -2, Flawed: -1, Average: 0, Trained: 1, Exceptional: 2, Master: 3, Legendary: 4 }, '2': { Cursed: -2, Flawed: -1, Average: 0, Trained: 1, Exceptional: 2, Master: 4, Legendary: 5 }, '3': { Cursed: -2, Flawed: -1, Average: 0, Trained: 1, Exceptional: 3, Master: 4, Legendary: 5 }, '4': { Cursed: -2, Flawed: -1, Average: 0, Trained: 2, Exceptional: 3, Master: 5, Legendary: 6 }, '5': { Cursed: -2, Flawed: -1, Average: 1, Trained: 2, Exceptional: 4, Master: 5, Legendary: 6 }, '6': { Cursed: -1, Flawed: 0, Average: 1, Trained: 3, Exceptional: 4, Master: 6, Legendary: 7 }, '7': { Cursed: -1, Flawed: 0, Average: 1, Trained: 3, Exceptional: 5, Master: 6, Legendary: 7 }, '8': { Cursed: -1, Flawed: 0, Average: 1, Trained: 3, Exceptional: 5, Master: 7, Legendary: 8 }, '9': { Cursed: -1, Flawed: 0, Average: 1, Trained: 4, Exceptional: 6, Master: 7, Legendary: 8 }, '10': { Cursed: -1, Flawed: 0, Average: 2, Trained: 4, Exceptional: 6, Master: 8, Legendary: 9 } }; const valid_levels = ['0.25', '0.5', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']; ['pe', 'sd', 'wl', 'fc'].forEach(comp => { on(`change:level change:${comp}comp sheet:opened`, () => { getAttrs([`${comp}comp`, 'level'], values => { const output = {}; const level = values.level; if(valid_levels.includes(level)) { const comp_level = table_proficiencies[level] || table_proficiencies['1']; const comp_label = values[`${comp}comp`]; output[`${comp}mod`] = comp_level[comp_label] || 0; } else { output[`${comp}mod`] = 0; } setAttrs(output); }); }); }); on('change:level change:repeating_skills2:skillcomp sheet:opened', () => { getSectionIDs('repeating_skills2', idarray => { const fieldnames = idarray.reduce((arr, id) => [...arr, `repeating_skills2_${id}_skillcomp`], []); getAttrs([...fieldnames, 'level'], values => { const output = {}; const level = values.level; idarray.forEach(id => { if(valid_levels.includes(level)) { const comp_level = table_proficiencies[level] || table_proficiencies['1']; const comp = values[`repeating_skills2_${id}_skillcomp`]; output[`repeating_skills2_${id}_rank`] = comp_level[comp] || 0; } else { output[`repeating_skills2_${id}_rank`] = 0; } }); setAttrs(output); }); }); });