If the presidential candidate withdraws during the campaign (post-nomination but pre-election), would the VP candidate take over?
The national political party (its national committee) would choose the new candidate, who might be the VP candidate. That for example is what happened in 1972, when the VP candidate nominated by the Democratic convention, Thomas Eagleton, withdrew, and was replaced by Sargent Shriver.
There might be competing political pressures. A party would not want to openly declare that its VP candidate was not ready to take over as the presidential candidate, since it would imply that he hadn't really been fit for the job of vice president either. But the VP candidate might represent an opposing faction of the party, and was named in an effort to balance the ticket. Depending on the circumstances of the presidential candidate's withdrawal, he might be able to influence the decision.
Legally, there is no national candidate, but rather the state party in each state puts forward a slate of elector candidates, running for the party, and using the name of the presidential and VP candidate as a slogan. It would be up to the individual state election laws, and when the candidate withdrew, whether the ballots could be modified or not.