Clean the throttle body. I'm guessing it all started after the battery went dead

If that doesn't take car of all of it, adjust the base idle so you read about 15 on IAC counts(using a scan tool) at a hot idle in park/neutral. You'll need to reset TPS voltage to .42-.46 if you adjust the base idle. Set the base idle properly before TPS adjustment.