Not sure why you would want to spend more than say an hour getting to MXP as there is more fun to be had in Milan than on the way to MXP. Given the flexibility of your schedule I would take a train either from Cadorna or Stazione Centrale depending on where you'll be in Milan.
Have a nice lunch, get some gelato and coffee, see a museum or do some shopping and then take the train.