Notwithstanding any provisions to the contrary contained in any city or county charter, and to the extent provided by the city and the county pursuant to appropriate legislative enactment, employees of the combined city and county health department may be included in the personnel system or civil service and retirement plans of the city or the county or a personnel system for the combined city and county health department that is separate from the personnel system or civil service of either county or city: PROVIDED, That residential requirements for such positions shall be coextensive with the county boundaries: PROVIDED FURTHER, That the city or county is authorized to pay such parts of the expense of operating and maintaining such personnel system or civil service and retirement system and to contribute to the retirement fund in behalf of employees such sums as may be agreed upon between the legislative authorities of such city and county.