Mostly PSA, always disconnect battery before disturbing computer/sensors wiring. Or follow manual.
Clean and reseat connectors 1st, do not remove and/or adjust the STPS (Secondary Throttle Plate Sensor) unless you are familiar with how it works, note/mark initial position, etc. Secondary throttle plate or valve works mostly at low to medium throttle positions too smooth out transitions, etc., but it also can affect other situations, it kinda allows the use larger bore throttle body in a smaller engine, its controlled by computer/ECM from other sensor data/input. Plenty of internet discussion on them, but most agree they must be properly set to work correctly, as in no fault codes

.
BTW, some connectors on TB are identical don't mix up. Sometimes cleaning ECM connectors also helps.
Idle is controlled by ISC (idle speed control).