Hello,
Assuming that the list of fields is fieldname1, fieldname2, fieldname3, fieldname4, fieldname5, fieldname6, fieldname7, fieldname8, fieldname9, and fieldname10, and that current equation is the sum of all of them:
fieldname1+fieldname2+fieldname3+fieldname4+fieldname5+fieldname6+fieldname7+fieldname8+fieldname9+fieldname10
In this case the equation can be edited as follows:
(function(){
var total = fieldname1+fieldname2+fieldname3+fieldname4+fieldname5+fieldname6+fieldname7+fieldname8+fieldname9+fieldname10, count=0;
if(fieldname1) count++;
if(fieldname2) count++;
if(fieldname3) count++;
if(fieldname4) count++;
if(fieldname5) count++;
if(fieldname6) count++;
if(fieldname7) count++;
if(fieldname8) count++;
if(fieldname9) count++;
if(fieldname10) count++;
if(5<=count) return total*0.9;
return total;
})()
and that’s all.
If you need additional help implementing your project, I can offer you a custom coding service through my personal website:
https://cff.dwbooster.com/customization
Best regards.