In a small saucepan, whisk together the soy sauce, mirin, sake, and granulated sugar. Add the onion, ginger, and garlic.
Place the saucepan over high heat and bring the mixture to a boil.
Once boiling, reduce the heat to a simmer and cook, whisking occasionally, for 8 minutes. The sugar should be completely dissolved.
Strain the mixture to discard the onion, ginger, and garlic.
Return the strained teriyaki sauce to the saucepan and bring back to a boil.
In a small bowl, whisk together the cornstarch and water until smooth. Pour into the boiling teriyaki sauce. Allow to cook, whisking often, until the teriyaki sauce has thickened.
If not using right away, allow the teriyaki sauce to cool to room temperature, then store in an airtight container and refrigerate for up to 2 weeks.