On optimal maintenance of degrading multistate systems with state‐dependent cost of repair