Try this. In attachment.
I've made two buttons for Mono and RGB.
If some IDs are already used in RGB or Mono Masks then these IDs will be skipped.
And element naming is changed a little.
Author would make such features different or even better, but I guess he's not interested in updates now. Maybe not.
Anyway, I don't mind to update this script from time to time and I enabled notification in this topic.