Okay, for all the checkboxes you want to hide, you'll need to give them both an individual class, and a hidden input. If they follow the same rule for how they are hidden, you can get away with one input, but you need at least one input for each different rule (each wound level from 1-5 in your case). This is because of a limitation in the way CSS works, and I wish it wasn't so (You cannot test for values greater than or less than, you can only test for equals or not equals). So, the HTML for the foc wounds could be < div class= "wounds-row lblue" > < div class= "wounds-title" > Light </ div > < div class= "wounds-options" > < input type= "checkbox" name= "attr_cl1" > < input type= "checkbox" name= "attr_cl2" > < input type= "hidden" name= "attr_foc_1" class= "wound" > < input type= "checkbox" name= "attr_cl3" class= "hide" > < input type= "hidden" name= "attr_foc_4" class= "wound" > < input type= "checkbox" name= "attr_cl4" class= "hide" > </ div > </ div > <!-- Second set of rows --> < div class= "wounds-row lblue" > < div class= "wounds-title" > Severe </ div > < div class= "wounds-options" > < input type= "checkbox" name= "attr_cs1" > < input type= "checkbox" name= "attr_cs2" > < input type= "hidden" name= "attr_foc_2" class= "wound" > < input type= "checkbox" name= "attr_cs3" class= "hide" > < input type= "hidden" name= "attr_foc_5" class= "wound" > < input type= "checkbox" name= "attr_cs4" class= "hide" > </ div > </ div > <!-- Third set of rows --> < div class= "wounds-row lblue" > < div class= "wounds-title" > Critical </ div > < div class= "wounds-options" > < input type= "checkbox" name= "attr_cc1" > < input type= "hidden" name= "attr_foc_3" class= "wound" > < input type= "checkbox" name= "attr_cc2" class= "hide" > </ div > </ div > </ div > Notice there's a hidden attribute just before the checkbox that will be hidden, which also has a class. This method allows you to use the same CSS rule as before: input.stat-show:not ([ value = "1" ]) + div.combat-checkboxes , input.wound:not ([ value = "1" ]) + input .hide { display : none ; } Finally, the tricky part is the Sheet worker. const wounds = [ "foc" , /* other wound stats */ ]; wounds . forEach ( wound => { on ( `change: ${ wound } ` , () => { getAttrs ([ wound ], values => { const wound = Math . min ( 5 , Math . max ( 0 , + values [ wound ] || 0 )); // wound must range from 0 to 5. const output = {}; [ 1 , 2 , 3 , 4 , 5 ]. forEach ( box => { if ( box <= wound ) { output [ ` ${ wound } _ ${ box } ` ] = 1 ; } else { output [ ` ${ wound } _ ${ box } ` ] = 0 ; } }); setAttrs ( output ); }); }); }); Anyone who's followed my posts knows I'd swap that if statement for a ternary operator: const wounds = [ "foc" , /* other wound stats */ ]; wounds . forEach ( wound => { on ( `change: ${ wound } ` , () => { getAttrs ([ wound ], values => { const wound = Math . min ( 5 , Math . max ( 0 , + values [ wound ] || 0 )); // wound must range from 0 to 5. const output = {}; [ 1 , 2 , 3 , 4 , 5 ]. forEach ( box => { output [ ` ${ wound } _ ${ box } ` ] = ( box <= wound ) ? 1 : 0 ; }); setAttrs ( output ); }); }); }); These two sheet workers are identical in function, the second just has a slightly less understandable but more compact if statement. Again, once you've verified this works in the way you want, you might want to use the sheet:opened trick to get everyone initially updated, and then remove it once every sheet has been opened at least once.