You could do it in steps, unless there is a better way.
Get the percent that Haste gives you for ranged attacks:
https://wow.gamepedia.com/API_GetCombatRatingBonus
Code:
local hastePercent = GetCombatRatingBonus(CR_HASTE_RANGED)
Then multiply the weapon's base attack speed by the above, and subtract that amount from the base.
GetRangedHaste() might also work, but the API isn't documented on Wowpedia; you'll have to check the API docs.
https://wow.gamepedia.com/World_of_W...API#Paper_Doll