Several systems can perform their intended functions at more than two different levels, from perfectly working to completely failed. These kind of systems are known as multistate systems. In many complex and sophisticated systems, reliability and maintainability theory plays a very important role in maintaining such systems. The purpose of MSS maintenance optimization is to extend system lifetime, or at least the mean time to the next failure whose repair may be costly. Furthermore, it is expected that effective maintenance policies can increase system availability and reduce the consequences of unavailability (unaccomplished demand). In this study, we consider cyclic replacement policy in a preventive maintenance planning for a component subject to failure. This paper introduces a new approach based on PSO with constraints handling for MSS maintenance optimization problems. The universal generating function is applied in this work to evaluate MSS reliability. Our approach is tested in a real MSS maintenance problem in full measure in the state-of-the-art. The main advantage of the suggested approach is that it can be easily implemented in practice for maintenance of real MSS.