In this paper, a risk model where claims arrive according to a Markovian arrival process (MAP) is considered. A generalization of the well-known Gerber-Shiu function is proposed by incorporating the maximum surplus level before ruin into the penalty function. For this wider class of penalty functions, we show that the generalized Gerber-Shiu function can be expressed in terms of the original Gerber-Shiu function (see e.g. [Gerber, Hans U., Shiu, Elias, S.W., 1998. On the time value of ruin. North American Actuarial Journal 2(1), 48-72]) and the Laplace transform of a first passage time which are both readily available. The generalized Gerber-Shiu function is also shown to be closely related to the original Gerber-Shiu function in the same M...