In this paper, we consider a system consisting of two major units, A and B, each subject to two types of shocks that occur according to a non-homogeneous Poisson process. A type II shock causes a complete system failure which is corrected by a replacement; and a type I shock causes a unit A minor failure, which is rectified by a minimal repair. The shock type probability is age-dependent. Each unit A minor failure results in a random amount of damage to unit B. Such a damage to unit B can be accumulated to a specified level of the complete system failure. Moreover, unit B with a cumulative damage of level may become minor failed with probability at each unit A minor failure, and fixed by a minimal repair. We consider a more general replacement policy where the system is replaced at age , or the th type I shock, or first type II shock, or when the total damage to unit B exceeds a specified level, whichever occurs first. We determine the optimal policy of and to minimize the s-expected cost per unit time. We present some numerical examples, and show that our model is the generalization of many previous maintenance models in the literature.Index Terms-Cumulative damage model, optimization, replacement policy., shock model.