Condition-based maintenance (CBM) powered by corrosion inspection is vital to ensure the service safety and availability of equipment structure, especially in harsh natural environments. Preventive repair and coating are two effective measures widely adopted in corrosion-centered CBM implementation, whose collaborative planning, however, is rarely reported in corrosion control models. This paper proposes a hierarchical CBM policy oriented to gradual corrosion deterioration, which quantifies the comprehensive effect of corrosive environment and uncertain coating lifetime. The long-term corrosion is governed by a generalized stochastic process incorporating multiple environmental factors. Inspections are equally spaced to reveal corrosion severity, followed by a combination of recoating, imperfect repair and replacement to restore structure health. In particular, repair is executed if the accumulated corrosion exceeds a safe control limit, and replacement is immediate if (a) the repair number attains a pre-set threshold, and (b) the residual corrosion after repair remains above the limit. The impact of random coating lifetime on CBM performance is also analytically analyzed. The long-run maintenance cost is minimized through the joint optimization of inspection interval, corrosion control limit, and imperfect repair number. The model applicability is demonstrated through numerical experiments conducted on ship deck structures under marine environment.