Replacing a whole engine at sea is something I wouldn't necessarily expect to be done often. Do they swap out wings while underway too? Having to stick a pile of spare engines in storage and replenish them when you dock doesn't seem like the worst limitation to have.
I don't know the details on how often engines get repaired, that's a good question.
The lack of ability to do it during a "Real War" means that if the engine has problems, that fighter is now sitting in the hangar useless, except for parts to cannibalize.
In terms of the F-35 engines they under-speced them, so they have to run twice as hot[0] to cool the electronics:
"The original program engine specification allocated 15 kW [kilowatts] of bleed air extraction to support system cooling requirements, and the F135 engine was designed, tested, and qualified to this specification with a level of margin available for future growth," Schmidt wrote. "During the final stages of initial aircraft development, air vehicle cooling requirements grew to exceed planned bleed air extraction."
"To provide the necessary bleed air, the engine is required to run hotter, and the program is realizing the effects of this through an increase in operating temperature, and a decrease in engine life, which is driving earlier depot inductions and an increase in lifecycle cost,"[1][2]
> The lack of ability to do it during a "Real War" means that if the engine has problems, that fighter is now sitting in the hangar useless, except for parts to cannibalize.
If it has problems severe enough that the engine can't be repaired and must be replaced, and they don't have sufficient replacement stock, yes. But what I was trying to get at with my question about replacing the wing is that having an aircraft return to the carrier damaged severely enough that it's unflyable and unrepairable must be a somewhat routine/normal occurrence during "real war". (Of course the more you can repair while underway the better, all else being equal).
Oh you absolutely can change an engine at sea. Naval aircraft are very modular for good reason. Engines can be removed and tested (there's a whole massive test jig and setup on the fantail for it), and removed and replaced at sea.
A whole wing replacement, I'm actually not sure but it wouldn't surprise me at all.
You might not see a port for nine months or a year -- that's not an acceptable amount of time to just have a plane or multiple planes down waiting on parts that are available. There's no way to get them off the ship other than a crane pierside if they can't fly.
The entire reason for the switch from the C-2 to the MV-22 for Carrier resupply was to be able to bring an F35 engine replacement aboard.