; and (2) by adding at the end the following: (e) Prevention and family services and programs (1) In general Subject to the succeeding provisions of this subsection, the Secretary may make a payment to a State for providing the following services or programs for a child described in paragraph (2) and the parents or kin caregivers of the child when the need of the child, such a parent, or such a caregiver for the services or programs are directly related to the safety, permanence, or well-being of the child or to preventing the child from entering foster care: (A) Mental health and substance abuse prevention and treatment services Mental health and substance abuse prevention and treatment services provided by a qualified clinician for not more than a 12-month period that begins on any date described in paragraph (3) with respect to the child. (B) In-home parent skill-based programs In-home parent skill-based programs for not more than a 12-month period that begins on any date described in paragraph (3) with respect to the child and that include parenting skills training, parent education, and individual and family counseling. (2) Child described For purposes of paragraph (1), a child described in this paragraph is the following: (A) A child who is a candidate for foster care (as defined in section 475(13)) but can remain safely at home or in a kinship placement with receipt of services or programs specified in paragraph (1). (B) A child in foster care who is a pregnant or parenting foster youth. (3) Date described For purposes of paragraph (1), the dates described in this paragraph are the following: (A) The date on which a child is identified in a prevention plan maintained under paragraph (4) as a child who is a candidate for foster care (as defined in section 475(13)). (B) The date on which a child is identified in a prevention plan maintained under paragraph (4) as a pregnant or parenting foster youth in need of services or programs specified in paragraph (1). (4) Requirements related to providing services and