I'll write it again...a very common source of slow leaks on older AC/heat pump systems is aging Schrader valves. This is as true on a boat as it is ashore.
The core of these valves unscrew and can be replaced. There are also caps with o-rings to seal over them. Both core kits and caps with seals are available on Amazon and many other places.
If the compressor sounds bad. If the coils look bad. If things are dented scraped corroded, etc. That's one situation. Damage can cause leaks. A failing compressor is failing.
But, especially if the unit is older and seems to run well, except that it started to cool less and less over weeks to years....I'd try adding a dye, charging it, and capping it. If you want, replace the valve cores first: They just unscrew.
More often than not that'll solve the problem. Not always. But often. I bet more than half the time.
How long will you get after that? Until something in the old unit fails. Aging is funny. Some AC units last ~5years. Some ~30years. And many are replaced due to corroded, leaky drip pans, general corrosion and aging, inefficiency, and older controls -- not hard failure.