Another option is:
Split the question.
Ask for the percentages in a question of type "multiple numerical input".
Here use the setting "sum=100".
That's all. You do not need a validation.
"Remaining" and "Total" are shown automatically.
The respondents enter the percentages manually, what in my opinion is faster than to click a dropdown and scroll to the desired value.
In the next question you ask the "Opportunities for Optimization" for items with a percentage>0.
This you may do now in a question of type "array". So the javascript is not needed.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless