Any licensed residential treatment facility that provides adult mental health or substance abuse treatment services, or both, and receives state funds for the provision of such services shall prepare a discharge plan, including housing referrals, for each client receiving such services prior to such client’s release from such residential treatment facility. The Commissioner of Mental Health and Addiction Services may adopt regulations, in accordance with chapter 54, to carry out the provisions of this section.