A funding agreement for a State for a grant under section 300x–21 of this title is that, in expending the grant for the purpose of providing treatment services in penal or correctional institutions of the State, the State will not expend more than an amount equal to the amount expended for such purpose by the State from the grant made under section 300x–1a  of this title to the State for fiscal year 1991 (as section 300x–1a  of this title was in effect for such fiscal year).
With respect to compliance with the agreement made under subsection (a), a State may expend a grant under section 300x–21 of this title to provide inpatient hospital services as treatment for substance use disorders only if it has been determined, in accordance with guidelines issued by the Secretary, that such treatment is a medical necessity for the individual involved, and that the individual cannot be effectively treated in a community-based, nonhospital, residential program of treatment.
In the case of an individual for whom a grant under section 300x–21 of this title is expended to provide inpatient hospital services described in paragraph (1), a funding agreement for the grant for the State involved is that the daily rate of payment provided to the hospital for providing the services to the individual will not exceed the comparable daily rate provided for community-based, nonhospital, residential programs of treatment for substance abuse.
The Secretary may provide to any State a waiver of the restriction established in subsection (a)(1)(C) for the purpose of authorizing the State to expend a grant under section 300x–21 of this title for the construction of a new facility or rehabilitation of an existing facility, but not for land acquisition.
In granting a waiver under paragraph (1), the Secretary shall allow the use of a specified amount of funds to construct or rehabilitate a specified number of beds for residential treatment and a specified number of slots for outpatient treatment, based on reasonable estimates by the State of the costs of construction or rehabilitation. In considering waiver applications, the Secretary shall ensure that the State has carefully designed a program that will minimize the costs of additional beds.
The Secretary may grant a waiver under paragraph (1) only if the State agrees, with respect to the costs to be incurred by the State in carrying out the purpose of the waiver, to make available non-Federal contributions in cash toward such costs in an amount equal to not less than $1 for each $1 of Federal funds provided under section 300x–21 of this title.
The Secretary shall act upon a request for a waiver under paragraph (1) not later than 120 days after the date on which the request is made.