If I understand your request correctly, you are trying to locate the the peak that exceeds the threshold by the gretest amount. If not, disregard this reply.
I would suggest you contruct an array of thresholds such that ther is a one to one corespondence between the values in this new array and your array of amplitudes and that each value (in the new array) is the threshold that applies to that frequency.
Then subtract the threshold array from your amplitude array. The resulting array can then be used to locate the peak you are seeking.
Trying to help,
Ben