A discrete-time approach to evaluate path-dependent derivatives under a regime-switching risk model