The following works:
prm best_rwp 1e10 val_on_continue = If(Get(r_wp) < Val, Get(r_wp), Val);
prm best_cycle 0 val_on_continue = If(Get(r_wp) == best_rwp, Cycle, Val);
best_cycle is updated and can be outputted to a file.
However, it may well be best to see all of the data using out_prm_vals_on_convergence.