Here is a link to writing to a text file for Katalon Studio.
A CSV file could be thought of as a text file with comma separators, so you might be like:
hoursRoleA = ...
hoursRoleA = hoursRoleA.replace(",", "")
hoursRoleB = ...
hoursRoleB = hoursRoleA.replace(",", "")
data.WriteToFile('projectTitle, hoursRoleA, hoursRoleB')
or maybe even try to write the hours direct to the file by using the double quotes,
data.WriteToFile('projectTitle, "${hoursRoleA}", "${hoursRoleB}"')