Well, it's tough to see Djokovic losing here before the QFs, so if we use that as a floor for his point total, he'll be ahead by about 350 points. So the earliest he realistically loses #1 is Shanghai (5 weeks), putting him at 394.
Regardless of that floor, I think Djokovic holds onto #1 at least until the ATP Finals (through either Alcaraz not winning USO or Djokovic making the final), which gives him another 5 weeks.
So if you think Djokovic ends the year as #1, he'll pass 400 this year. But if he doesn't hold #1 going into next year, his best chance will be the Sunshine Double. I think Djokovic pulls off another YE#1 and takes it in 2023.