My explanation is getting long-winded here, but the answer is, attempting to use a continuous definition of sensitivity index is not going to be meaningful for your problem.
It is possible to find the sensitivity of a discontinuous function with respect to a parameter at a specific point of discontinuity, so if the problem could be posed with functions having domains over the reals, the problem would be well-posed; there exists mathematics to deal with these types of problems. (I'm having trouble tracking down a good source, since the canonical one appears to be E. N. Rozenvasser, "General sensitivity equations of discontinuous systems," Automat. Remote Control (1967), 400–404, and every other paper I've seen seems to cite this one.)
The problem is that moduli have integer-valued arguments, and you're trying to obtain the response to differential (i.e., very small) changes in parameters. It's impossible to meaningfully define what happens in the limit as your change in $m$ goes to zero, so this definition of sensitivity is not going to get you anywhere. I don't believe that switching to a discrete differential operator will remedy that problem in a meaningful way. However, you could search the literature and see if anything comes up; I found some work on sensitivity analysis of discrete stochastic dynamical systems that exists, but upon a quick read, I don't think it generalizes to your work readily. (Your mileage may vary.) If you want to do sensitivity analysis on this problem, there are probably approaches better-suited to your problem, such as sampling.