In this study, we propose a generalised replacement model for a deteriorating system with failures that could only be detected through inspection work. The system is assumed to have two types of failures and is replaced at the Nth type I failure (minor failure) or first type II failure (catastrophic failure), depending on whichever occurs first. The probability of type I and II failures depends on the number of failures since the last replacement. Such systems can be repaired upon type I failure, but are stochastically deteriorating, that is, the lengths of the operating intervals are stochastically decreasing, whereas the durations of the repairs are stochastically increasing. Then, the expected net cost rate is obtained. Some special cases are considered. Finally, a numerical example is provided.