Is there a way to conditionally ignore coverpoints?

can i use condition around the option.weight statement? like

if (cfg==“X”) {
option.weight = 0;
} // for non-X cfgs, weight will be non-zero