Thanks for the tip Rich @rlkoshak , the solution appeared to be the following:
var MyFlow = Integer.parseInt(Port2_Flow_Bytes, 16).shortValue() as Number
I reckon it might be useful to add this two conversions in your tutorial for stupid guys like me.