In general, a complex system is composed of different components that are usually subject to a maintenance policy. We take into account systems containing components that are under both preventive and corrective maintenance. Preventive maintenance is considered as a failure-based preventive maintenance model, where full renewal is realized after the occurrence of every nth failure. It offers an imperfect corrective maintenance model, where each repair deteriorates the component or system lifetime, the probability distribution of which gradually changes via increasing failure rates. The reliability mathematics for unavailability quantification is demonstrated in the paper. The renewal process model, involving failure-based preventive maintenance, arises from the new corresponding renewal cycle, which is designated a real ageing process. Imperfect corrective maintenance results in an unwanted rise in the unavailability function, which can be rectified by a properly selected failure-based preventive maintenance policy; i.e., replacement of a properly selected component respecting both cost and unavailability after the occurrence of the nth failure. The number n is considered a decision variable, whereas cost is an objective function in the optimization process. The paper describes a new method for finding an optimal failure-based preventive maintenance policy for a system respecting a given reliability constraint. The decision variable n is optimally selected for each component from a set of possible realistic maintenance modes. We focus on the discrete maintenance model, where each component is realized in one or several maintenance mode(s). The fixed value of the decision variable determines a single maintenance mode, as well as the cost of the mode. The optimization process for a system is demanding in terms of computing time because, if the system contains k components, all having three maintenance modes, we need to evaluate 3k maintenance configurations. The discrete maintenance optimization is shown with two systems adopted from the literature.