First, power wash your engine at a DIY car wash. Use GUNK orange. When everything is clean as showroom, examine your battery cables at BOTH ends. Your problem sounds like a grounding fault. Check the ground at your alternator, and the grounding part of your negative battery cable. If either battery cable is found to have corrosion creeping under the insulator, replace it with a genuine Toyota part. It is NOT that expensive. These engines (assuming it is the 4 cylinder and not the V6) are vulnerable to clogged fuel injectors. Toyota has a procedure to clean them. Check with your dealership. They will begin by cleaning your throttle body and plate, and the IDLE AIR CONTROL VALVE. You can do the same with a can of Gum-out psray. Good luck!!