Does he not eat any real chicken food?
Corn and vegetables don't give him enough proper nutrition, there's no protein and too high carbs.
Onions are toxic to chickens
He's likely suffering for malnutrition or anemia from the onions.
You can try giving him a high protein feed that's not a layer...