You mentioned having 6 stats, each of which would need a worker like this. Here's a way to create all 6, without needing to write them all out. After the code, I'll explain how to adjust it for you need. const stats = { aura : [ 'blu' , 'cmd' , 'crg' , 'degu' , 'pss' , 'sed' ], }; Object . keys ( stats ). forEach ( stat => { // convert the stats into an array, and loop through them const skills = stats [ stat ]; // get the array of stats inside each master stat skills . forEach ( skill => { on ( 'change:' + stat + ' change:' + skill + ' change:repeating_' + skill + '_specs remove:repeating_' + skill + 'specs sheet:opened' , function () { getSectionIDs ( 'repeating_' + skill + 'specs' , function ( idarray ) { const specs = []; const spectypes = []; for ( let i = 0 ; i < idarray . length ; i ++) { specs . push ( 'repeating_' + skill + 'specs_' + idarray [ i ] + '_' + skill + 'spec' ); // met les valeurs des repeating specs existants dans le champ des stats à récupérer spectypes . push ( 'repeating_' + skill + 'specs_' + idarray [ i ] + '_' + skill + 'spectype' ); // met les valeur du stat de base des repeating skills existants dans le champ des stats à récupérer } getAttrs ([ stat , skill , ... specs , ... spectypes ], function ( values ) { var update = {}; const skill_score = parseInt ( values [ stat ], 10 )|| 0 ; // extrait la valeur de l'aura, en décimal const subskill_score = parseInt ( values [ skill ], 10 )|| 0 ; // extrait la valeur de l'skill, en décimal update [ skill + 'dice' ] = Math . floor (( skill_score + subskill_score )/ 3 ); update [ skill + 'pip' ] = ( skill_score + subskill_score ) % 3 ; for ( let i = 0 ; i < idarray . length ; i ++) { const spec_score = parseInt ( values [ specs [ i ]], 10 )|| 0 ; // extrait la valeur de la repspec, en décimal const spec_type = values [ spectypes [ i ]]; // extrait le type de la repsk if ( spec_type == skill ) { // si le type du repeating_auraspecs == skill il faut mettre à jour update [ specs [ i ] + 'dice' ] = Math . floor (( skill_score + subskill_score + spec_score )/ 3 ); update [ specs [ i ] + 'pip' ] = ( skill_score + subskill_score + spec_score ) % 3 ; } } setAttrs ( update ); // affecte les nouvelles valeurs }); }); }); }); }); To make it work for you, first try it out as is (after removing the original worker - very important !). It should work for your aura skills. Once youre sure its working okay (I havent tested it!), you just need to edit this bit: const stats = { aura: ['blu','cmd','crg','degu','pss','sed'], }; Just add another line with a label for your stat name, and an array of the skills based on it, and a comma at the end. These (the stat name and skill names) must be exactly as used in your attribute names (and repeating section name for the stat). So if you have a stat named chill , its repeating section should be called repeating_chillspecs with attributes chillspec and chillspectype . Everything must be named in the correct format, but if so, this should handle all 6 stats.