Your attempt is close.
#!/bin/bash
sum=0
while IFS=, read -a fields; do
if [[ ${fields[12]} = "$1" ]]; then
(( sum += fields[5] ))
fi
done < file.csv
printf 'sum: %d\n' "$sum"
You can shorten the if..then..fi using short-scircuit logic if you prefer ex.
[[ ${fields[12]} = "$1" ]] && (( sum += fields[5] ))
There's no need to skip the header line explicitly since it will fail the ${fields[12]} = "$1" test