adverb
an adverb modifies a verb, adjective, or another adverb; in this case, 'masterfully' describes how something is done in a skillful or accomplished manner
-
The artist masterfully captured the essence of the landscape in his painting.
-
She masterfully juggled multiple tasks at work without breaking a sweat.
-
He played the guitar solo masterfully, totally shredding it!
-
The politician masterfully manipulated the situation to his advantage.