HSA Contributions with IRS Lookback Rule

I have an HDHP that began September 1, 2023.  I will keep this HDHP in effect Through July 2024 and begin Medicare upon turning 65 in August.


I would like to maximize my HSA contribution for 2023 Because I will be in a lower tax bracket beginning in 2024.  It appears to be $8300 ($7300+$1000), however, it’s unclear to me whether the HDHP must be in effect for every month through the end of  2024 (the look back period?) in order to avoid the overpayment after Medicare begins August 1, 2024.

 

Presuming that the look back period must be considered, making me in ineligible from August 2024 through the end of the year, Can I still maximize my contribution for 2023 by prorating it Email with four months of 2023+7 months of 2024?