Stochastic Approximation of Discontinuous Dynamics