AC leaks and mold are separate habitability issues
An air conditioner that leaks water or leads to mold is a habitability problem the landlord generally must address — regardless of whether AC itself was required — because water damage and mold fall under the landlord's duty to keep the home safe and sanitary.
AC units and their drain lines can leak, and the trapped moisture can feed mold. So even though the cooling function may be an amenity, the resulting water damage and mold are separate habitability issues the landlord is responsible for fixing.
Report a leaking AC promptly, because hidden moisture behind walls or under flooring can grow into a bigger problem. Document the leak and any mold with dated photos, and keep your written reports. If a leaking air conditioner has caused water damage or mold and your landlord will not address it, a free review can help you understand your options.
This is general information about California tenant rights, not legal advice. Every situation is different.