A young man has been sentenced for being part of an attack on a 17-year-old, the result of which left him suffering from blackouts.