Caveats if he lives.....
Reactions to the first partition treaty
Upon hearing about the treaty Charles II and the Spanish aristocracy were furious about this foreign attempt to carve up the Spanish empire. They did have less problems with Joseph as king and therefore Spain decided that he would rule the whole Spanish empire, and the Habsburgs and Louis would get nothing. On 14 November 1698 Charles the Sufferer proclaimed his will in which Joseph got all, and the others got nothing.
Upon hearing about this first partition treaty emperor Leopold was also outraged and felt betrayed, but this was not such a problem as Louis and William could have enforced the treaty. William's problem was solved in as far as that France would not get Spain and the Spanish Netherlands without a war. It was not solved with regard to the fact that Louis might go to war to get the Spanish Netherlands.
If he lives, any war should it be fought will be fought on the basis of the first partition treaty if France wants to at least have the neutrality of the Sea Powers.
France cannot just walk into Spain as OTL, as if war occurs, Spain would be opposed rather than allied. The French will fight for every inch of ground from the start.
The French only went to war OTL because they were named the sole heir, which gave them the best chance of obtaining what they realistically desired most from the inheritance, and in that they still utterly failed, though they did benefit from it. Louis is going to prefer negotiationover conflict if he can, since maximilian is in his favour they have the edge there to gain through direct negotiation with Spain after Joseph inherits.
The odds are simple. Louis can go to war and he has a good chance of obtaining the goals of the first partition, but it means war with Spain and the Empire ( The treaty is between France and The Sea powers only), and he has to bank on the Sea powers remaining neutral. That isn't a certainty.
One of the primary motivators for William III was the thought that this could well avoid a devastaing war in a chaotic and unknown situation. since a war has occurred anyways..William can reconsider if only to affect any negotiations Spain might undertake during the course of the resulting conflict. In so doing they will gain more currency by supporting Charles II's wishes than supporting the treaty that obviously was rejected by him and did not include the assent of the Emporer in the first place, no matter how much he has tired personally of the Hapsburg demands. Joseph inheriting everything also has its appeal, even if it does mean war as it ensures the Status quo in the balance of powers, something also desired by the Sea Powers.
In such a situation France would almost certainly lose. Louis is not that much the gambler. He will seek negotiation instead in the face of so many direct and potential enemies when he has no legitmate reason to go to war.
Savoy and Lorraine are probably out in the cold, but could stand to benefit in the latter case from subsequent negotiations. I could see perhaps Karl or the Dauphin or Phillip being appointed as regents for Joseph in some of the contested territories, and then being named heir, or their own heirs being named, upon Joseph's death. Alternatively Lorraine could play that role in part or all the Southern Netherlands upon surrender of their lands to say Karl Or the Dauphin. Something that is to be far more palatable for the Sea powers.
No there is far more rational for continuing a negotiated dialogue. It goes with out saying that Joseph will not inherit Bavaria. It will go to a junior son of Maximilian or a junior line of the Wittelsbach, there are several after all still existing among the various Rhineland principalities..