Charcoal, 26 bytes
≔⌈θη≔⌕θηζ≔⌈Φθ⁻κζζIEθ⎇⁼ιηζη Try it online! Link is to verbose version of code. Explanation:
≔⌈θη Get the maximum value of the input list.
≔⌕θηζ Get the index of its first occurrence.
≔⌈Φθ⁻κζζ Make a new list excluding that index, and take the maximum of that.
IEθ⎇⁼ιηζη Output that value for the maximum values in the list, and the maximum for the other values.
By comparison a fully golfed version would be 1919 9 bytes:
IEθ⎇⁼ι⌈θ⌈Φθ⁻μ⌕θ⌈θ⌈θIEθ⌈Φθ⁻μκ Try it online!Try it online! Link is to verbose version of code. Runs in O(n²) best case or O(n³) worst casetime. Explanation: For each element, creates a new list without that element, and takes the maximum of that list.