ruleIdx function

Calculates the weights for each modifier rule