Chosen Solution

when using MacBook on battery, it turns itself off after a few minutes of usage. After a minute or two, I can restart it for a few minutes.

You just need a new battery, if you have an older Core or Core 2 Duo white or black one, get this one here, or if you have a newer unibody, get this one (model A1278), or get this one (for Model A1342).